<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Homework Hub: packages/jQuery.UI.Combined.1.8.20.1/Content/Scripts/jquery-ui-1.8.20.js Quellcode</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Homework Hub
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Erzeugt von Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Suchen');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Hauptseite</span></a></li>
      <li><a href="namespaces.html"><span>Pakete</span></a></li>
      <li><a href="annotated.html"><span>Klassen</span></a></li>
      <li class="current"><a href="files.html"><span>Dateien</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Suchen" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Auflistung&#160;der&#160;Dateien</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Alle</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Klassen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namensbereiche</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funktionen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Propertys</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_93501a11e921083efbd154e0cdff5f10.html">packages</a></li><li class="navelem"><a class="el" href="dir_025d94c06889cfa8d09f79d900511bbb.html">jQuery.UI.Combined.1.8.20.1</a></li><li class="navelem"><a class="el" href="dir_a5b06276520dbfc6284deee4102bb984.html">Content</a></li><li class="navelem"><a class="el" href="dir_60761202cd6baeaa9e703637e697051d.html">Scripts</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">jquery-ui-1.8.20.js</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// prevent duplicate loading</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// this is only a problem because we proxy existing functions</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// and we don&#39;t want to double proxy them</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;$.ui = $.ui || {};</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keywordflow">if</span> ( $.ui.version ) {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;}</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;$.extend( $.ui, {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span>,</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    keyCode: {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        ALT: 18,</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        BACKSPACE: 8,</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        CAPS_LOCK: 20,</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        COMMA: 188,</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        COMMAND: 91,</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        COMMAND_LEFT: 91, <span class="comment">// COMMAND</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        COMMAND_RIGHT: 93,</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        CONTROL: 17,</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        DELETE: 46,</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        DOWN: 40,</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        END: 35,</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        ENTER: 13,</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        ESCAPE: 27,</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        HOME: 36,</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        INSERT: 45,</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        LEFT: 37,</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        MENU: 93, <span class="comment">// COMMAND_RIGHT</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        NUMPAD_ADD: 107,</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        NUMPAD_DECIMAL: 110,</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        NUMPAD_DIVIDE: 111,</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        NUMPAD_ENTER: 108,</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        NUMPAD_MULTIPLY: 106,</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        NUMPAD_SUBTRACT: 109,</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        PAGE_DOWN: 34,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        PAGE_UP: 33,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        PERIOD: 190,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        RIGHT: 39,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        SHIFT: 16,</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        SPACE: 32,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        TAB: 9,</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        UP: 38,</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        WINDOWS: 91 <span class="comment">// COMMAND</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    }</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;});</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">// plugins</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;$.fn.extend({</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    propAttr: $.fn.prop || $.fn.attr,</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    _focus: $.fn.focus,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    focus: <span class="keyword">function</span>( delay, fn ) {</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keywordflow">return</span> typeof delay === <span class="stringliteral">&quot;number&quot;</span> ?</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                var elem = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                    $( elem ).focus();</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                    <span class="keywordflow">if</span> ( fn ) {</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                        fn.call( elem );</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                    }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                }, delay );</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            }) :</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            this._focus.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    },</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    scrollParent: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        var scrollParent;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">if</span> (($.browser.msie &amp;&amp; (/(<span class="keyword">static</span>|relative)/).test(<span class="keyword">this</span>.css(<span class="stringliteral">&#39;position&#39;</span>))) || (/absolute/).test(this.css(<span class="stringliteral">&#39;position&#39;</span>))) {</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            scrollParent = this.parents().filter(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                <span class="keywordflow">return</span> (/(relative|absolute|fixed)/).test($.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;position&#39;</span>,1)) &amp;&amp; (/(<span class="keyword">auto</span>|scroll)/).test($.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;overflow&#39;</span>,1)+$.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;overflow-y&#39;</span>,1)+$.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;overflow-x&#39;</span>,1));</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            }).eq(0);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            scrollParent = this.parents().filter(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                <span class="keywordflow">return</span> (/(<span class="keyword">auto</span>|scroll)/).test($.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;overflow&#39;</span>,1)+$.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;overflow-y&#39;</span>,1)+$.curCSS(<span class="keyword">this</span>,<span class="stringliteral">&#39;overflow-x&#39;</span>,1));</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            }).eq(0);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="keywordflow">return</span> (/fixed/).test(this.css(<span class="stringliteral">&#39;position&#39;</span>)) || !scrollParent.length ? $(document) : scrollParent;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    },</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    zIndex: <span class="keyword">function</span>( zIndex ) {</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keywordflow">if</span> ( zIndex !== undefined ) {</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            <span class="keywordflow">return</span> this.css( <span class="stringliteral">&quot;zIndex&quot;</span>, zIndex );</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        }</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        <span class="keywordflow">if</span> ( this.length ) {</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;            var elem = $( <span class="keyword">this</span>[ 0 ] ), position, value;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            <span class="keywordflow">while</span> ( elem.length &amp;&amp; elem[ 0 ] !== document ) {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                <span class="comment">// Ignore z-index if position is set to a value where z-index is ignored by the browser</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                <span class="comment">// This makes behavior of this function consistent across browsers</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                <span class="comment">// WebKit always returns auto if the element is positioned</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                position = elem.css( <span class="stringliteral">&quot;position&quot;</span> );</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                <span class="keywordflow">if</span> ( position === <span class="stringliteral">&quot;absolute&quot;</span> || position === <span class="stringliteral">&quot;relative&quot;</span> || position === <span class="stringliteral">&quot;fixed&quot;</span> ) {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                    <span class="comment">// IE returns 0 when zIndex is not specified</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                    <span class="comment">// other browsers return a string</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                    <span class="comment">// we ignore the case of nested elements with an explicit value of 0</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                    <span class="comment">// &lt;div style=&quot;z-index: -10;&quot;&gt;&lt;div style=&quot;z-index: 0;&quot;&gt;&lt;/div&gt;&lt;/div&gt;</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                    value = parseInt( elem.css( <span class="stringliteral">&quot;zIndex&quot;</span> ), 10 );</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                    <span class="keywordflow">if</span> ( !isNaN( value ) &amp;&amp; value !== 0 ) {</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                        <span class="keywordflow">return</span> value;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                    }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                }</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;                elem = elem.parent();</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            }</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    },</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    disableSelection: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <span class="keywordflow">return</span> this.bind( ( $.support.selectstart ? <span class="stringliteral">&quot;selectstart&quot;</span> : <span class="stringliteral">&quot;mousedown&quot;</span> ) +</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;            <span class="stringliteral">&quot;.ui-disableSelection&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                event.preventDefault();</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            });</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    },</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    enableSelection: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="keywordflow">return</span> this.unbind( <span class="stringliteral">&quot;.ui-disableSelection&quot;</span> );</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    }</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;});</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;$.each( [ <span class="stringliteral">&quot;Width&quot;</span>, <span class="stringliteral">&quot;Height&quot;</span> ], <span class="keyword">function</span>( i, name ) {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    var side = name === <span class="stringliteral">&quot;Width&quot;</span> ? [ <span class="stringliteral">&quot;Left&quot;</span>, <span class="stringliteral">&quot;Right&quot;</span> ] : [ <span class="stringliteral">&quot;Top&quot;</span>, <span class="stringliteral">&quot;Bottom&quot;</span> ],</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        type = name.toLowerCase(),</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        orig = {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;            innerWidth: $.fn.innerWidth,</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            innerHeight: $.fn.innerHeight,</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            outerWidth: $.fn.outerWidth,</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;            outerHeight: $.fn.outerHeight</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        };</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <span class="keyword">function</span> reduce( elem, size, border, margin ) {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        $.each( side, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            size -= parseFloat( $.curCSS( elem, <span class="stringliteral">&quot;padding&quot;</span> + <span class="keyword">this</span>, <span class="keyword">true</span>) ) || 0;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            <span class="keywordflow">if</span> ( border ) {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                size -= parseFloat( $.curCSS( elem, <span class="stringliteral">&quot;border&quot;</span> + <span class="keyword">this</span> + <span class="stringliteral">&quot;Width&quot;</span>, <span class="keyword">true</span>) ) || 0;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            <span class="keywordflow">if</span> ( margin ) {</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                size -= parseFloat( $.curCSS( elem, <span class="stringliteral">&quot;margin&quot;</span> + <span class="keyword">this</span>, <span class="keyword">true</span>) ) || 0;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        });</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        <span class="keywordflow">return</span> size;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    }</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    $.fn[ <span class="stringliteral">&quot;inner&quot;</span> + name ] = <span class="keyword">function</span>( size ) {</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        <span class="keywordflow">if</span> ( size === undefined ) {</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            <span class="keywordflow">return</span> orig[ <span class="stringliteral">&quot;inner&quot;</span> + name ].call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        }</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;            $( this ).css( type, reduce( <span class="keyword">this</span>, size ) + <span class="stringliteral">&quot;px&quot;</span> );</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        });</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    };</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    $.fn[ <span class="stringliteral">&quot;outer&quot;</span> + name] = <span class="keyword">function</span>( size, margin ) {</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        <span class="keywordflow">if</span> ( typeof size !== <span class="stringliteral">&quot;number&quot;</span> ) {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;            <span class="keywordflow">return</span> orig[ <span class="stringliteral">&quot;outer&quot;</span> + name ].call( <span class="keyword">this</span>, size );</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        }</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;            $( <span class="keyword">this</span>).css( type, reduce( <span class="keyword">this</span>, size, <span class="keyword">true</span>, margin ) + <span class="stringliteral">&quot;px&quot;</span> );</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        });</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    };</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;});</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="comment">// selectors</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="keyword">function</span> focusable( element, isTabIndexNotNaN ) {</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    var nodeName = element.nodeName.toLowerCase();</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordflow">if</span> ( <span class="stringliteral">&quot;area&quot;</span> === nodeName ) {</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        var map = element.parentNode,</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;            mapName = map.name,</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;            img;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">if</span> ( !element.href || !mapName || map.nodeName.toLowerCase() !== <span class="stringliteral">&quot;map&quot;</span> ) {</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        }</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        img = $( <span class="stringliteral">&quot;img[usemap=#&quot;</span> + mapName + <span class="stringliteral">&quot;]&quot;</span> )[0];</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="keywordflow">return</span> !!img &amp;&amp; visible( img );</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    }</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="keywordflow">return</span> ( /input|select|textarea|button|<span class="keywordtype">object</span>/.test( nodeName )</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        ? !element.disabled</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        : <span class="stringliteral">&quot;a&quot;</span> == nodeName</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            ? element.href || isTabIndexNotNaN</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            : isTabIndexNotNaN)</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        <span class="comment">// the element and all of its ancestors must be visible</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        &amp;&amp; visible( element );</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;}</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="keyword">function</span> visible( element ) {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordflow">return</span> !$( element ).parents().andSelf().filter(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <span class="keywordflow">return</span> $.curCSS( <span class="keyword">this</span>, <span class="stringliteral">&quot;visibility&quot;</span> ) === <span class="stringliteral">&quot;hidden&quot;</span> ||</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            $.expr.filters.hidden( <span class="keyword">this</span> );</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    }).length;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;}</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;$.extend( $.expr[ <span class="stringliteral">&quot;:&quot;</span> ], {</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    data: <span class="keyword">function</span>( elem, i, match ) {</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;        <span class="keywordflow">return</span> !!$.data( elem, match[ 3 ] );</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    },</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    focusable: <span class="keyword">function</span>( element ) {</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;        <span class="keywordflow">return</span> focusable( element, !isNaN( $.attr( element, <span class="stringliteral">&quot;tabindex&quot;</span> ) ) );</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    },</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    tabbable: <span class="keyword">function</span>( element ) {</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;        var tabIndex = $.attr( element, <span class="stringliteral">&quot;tabindex&quot;</span> ),</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;            isTabIndexNaN = isNaN( tabIndex );</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;        <span class="keywordflow">return</span> ( isTabIndexNaN || tabIndex &gt;= 0 ) &amp;&amp; focusable( element, !isTabIndexNaN );</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    }</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;});</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;<span class="comment">// support</span></div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;$(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    var body = document.body,</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        div = body.appendChild( div = document.createElement( <span class="stringliteral">&quot;div&quot;</span> ) );</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="comment">// access offsetHeight before setting the style to prevent a layout bug</span></div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="comment">// in IE 9 which causes the elemnt to continue to take up space even</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="comment">// after it is removed from the DOM (#8026)</span></div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    div.offsetHeight;</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    $.extend( div.style, {</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        minHeight: <span class="stringliteral">&quot;100px&quot;</span>,</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        height: <span class="stringliteral">&quot;auto&quot;</span>,</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        padding: 0,</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        borderWidth: 0</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    });</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    $.support.minHeight = div.offsetHeight === 100;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    $.support.selectstart = <span class="stringliteral">&quot;onselectstart&quot;</span> in div;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="comment">// set display to none to avoid a layout bug in IE</span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="comment">// http://dev.jquery.com/ticket/4014</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    body.removeChild( div ).style.display = <span class="stringliteral">&quot;none&quot;</span>;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;});</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;<span class="comment">// deprecated</span></div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;$.extend( $.ui, {</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <span class="comment">// $.ui.plugin is deprecated.  Use the proxy pattern instead.</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    plugin: {</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;        add: <span class="keyword">function</span>( module, option, set ) {</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;            var proto = $.ui[ module ].prototype;</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;            <span class="keywordflow">for</span> ( var i in set ) {</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;                proto.plugins[ i ] = proto.plugins[ i ] || [];</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;                proto.plugins[ i ].push( [ option, set[ i ] ] );</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;            }</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;        },</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        call: <span class="keyword">function</span>( instance, name, args ) {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;            var set = instance.plugins[ name ];</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            <span class="keywordflow">if</span> ( !set || !instance.element[ 0 ].parentNode ) {</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;            }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    </div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;            <span class="keywordflow">for</span> ( var i = 0; i &lt; set.length; i++ ) {</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;                <span class="keywordflow">if</span> ( instance.options[ set[ i ][ 0 ] ] ) {</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;                    set[ i ][ 1 ].apply( instance.element, args );</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                }</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;            }</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;        }</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    },</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    </div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <span class="comment">// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()</span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    contains: <span class="keyword">function</span>( a, b ) {</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        <span class="keywordflow">return</span> document.compareDocumentPosition ?</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;            a.compareDocumentPosition( b ) &amp; 16 :</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;            a !== b &amp;&amp; a.contains( b );</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    },</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    </div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="comment">// only used by resizable</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    hasScroll: <span class="keyword">function</span>( el, a ) {</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    </div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;        <span class="comment">//If overflow is hidden, the element might have extra content, but the user wants to hide it</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;        <span class="keywordflow">if</span> ( $( el ).css( <span class="stringliteral">&quot;overflow&quot;</span> ) === <span class="stringliteral">&quot;hidden&quot;</span>) {</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;        }</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    </div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        var scroll = ( a &amp;&amp; a === <span class="stringliteral">&quot;left&quot;</span> ) ? <span class="stringliteral">&quot;scrollLeft&quot;</span> : <span class="stringliteral">&quot;scrollTop&quot;</span>,</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;            has = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    </div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        <span class="keywordflow">if</span> ( el[ scroll ] &gt; 0 ) {</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        }</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;        <span class="comment">// TODO: determine which cases actually cause this to happen</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        <span class="comment">// if the element doesn&#39;t have the scroll set, see if it&#39;s possible to</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;        <span class="comment">// set the scroll</span></div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;        el[ scroll ] = 1;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        has = ( el[ scroll ] &gt; 0 );</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        el[ scroll ] = 0;</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        <span class="keywordflow">return</span> has;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    },</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    </div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    <span class="comment">// these are odd functions, fix the API or move into individual plugins</span></div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    isOverAxis: <span class="keyword">function</span>( x, reference, size ) {</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;        <span class="comment">//Determines when x coordinate is over &quot;b&quot; element axis</span></div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        <span class="keywordflow">return</span> ( x &gt; reference ) &amp;&amp; ( x &lt; ( reference + size ) );</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    },</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    isOver: <span class="keyword">function</span>( y, x, top, left, height, width ) {</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;        <span class="comment">//Determines when x, y coordinates is over &quot;b&quot; element</span></div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;        <span class="keywordflow">return</span> $.ui.isOverAxis( y, top, height ) &amp;&amp; $.ui.isOverAxis( x, left, width );</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    }</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;});</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;})( jQuery );</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;<span class="comment">// jQuery 1.4+</span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="keywordflow">if</span> ( $.cleanData ) {</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    var _cleanData = $.cleanData;</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    $.cleanData = <span class="keyword">function</span>( elems ) {</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;        <span class="keywordflow">for</span> ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;            <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;                $( elem ).triggerHandler( <span class="stringliteral">&quot;remove&quot;</span> );</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;            <span class="comment">// http://bugs.jquery.com/ticket/8235</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;            } <span class="keywordflow">catch</span>( e ) {}</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;        }</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        _cleanData( elems );</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    };</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;} <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    var _remove = $.fn.remove;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    $.fn.remove = <span class="keyword">function</span>( selector, keepData ) {</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;            <span class="keywordflow">if</span> ( !keepData ) {</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;                <span class="keywordflow">if</span> ( !selector || $.filter( selector, [ <span class="keyword">this</span> ] ).length ) {</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;                    $( <span class="stringliteral">&quot;*&quot;</span>, this ).add( [ <span class="keyword">this</span> ] ).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;                        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;                            $( this ).triggerHandler( <span class="stringliteral">&quot;remove&quot;</span> );</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;                        <span class="comment">// http://bugs.jquery.com/ticket/8235</span></div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;                        } <span class="keywordflow">catch</span>( e ) {}</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;                    });</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;                }</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;            }</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;            <span class="keywordflow">return</span> _remove.call( $(<span class="keyword">this</span>), selector, keepData );</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        });</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;    };</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;}</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;$.widget = <span class="keyword">function</span>( name, base, prototype ) {</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;    var <span class="keyword">namespace </span>= name.split( &quot;.&quot; )[ 0 ],</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;        fullName;</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    name = name.split( <span class="stringliteral">&quot;.&quot;</span> )[ 1 ];</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    fullName = <span class="keyword">namespace </span>+ &quot;-&quot; + name;</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="keywordflow">if</span> ( !prototype ) {</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;        prototype = base;</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;        base = $.Widget;</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    }</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;    <span class="comment">// create selector for plugin</span></div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    $.expr[ <span class="stringliteral">&quot;:&quot;</span> ][ fullName ] = <span class="keyword">function</span>( elem ) {</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;        <span class="keywordflow">return</span> !!$.data( elem, name );</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    };</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    $[ namespace ] = $[ namespace ] || {};</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    $[ namespace ][ name ] = <span class="keyword">function</span>( options, element ) {</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;        <span class="comment">// allow instantiation without initializing for simple inheritance</span></div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;        <span class="keywordflow">if</span> ( arguments.length ) {</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;            this._createWidget( options, element );</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;        }</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;    };</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    var basePrototype = <span class="keyword">new</span> base();</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    <span class="comment">// we need to make the options hash a property directly on the new instance</span></div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;    <span class="comment">// otherwise we&#39;ll modify the options hash on the prototype that we&#39;re</span></div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    <span class="comment">// inheriting from</span></div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;<span class="comment">//  $.each( basePrototype, function( key, val ) {</span></div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;<span class="comment">//      if ( $.isPlainObject(val) ) {</span></div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;<span class="comment">//          basePrototype[ key ] = $.extend( {}, val );</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;<span class="comment">//      }</span></div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;<span class="comment">//  });</span></div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    basePrototype.options = $.extend( <span class="keyword">true</span>, {}, basePrototype.options );</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    $[ namespace ][ name ].prototype = $.extend( <span class="keyword">true</span>, basePrototype, {</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;        <span class="keyword">namespace</span>: <span class="keyword">namespace</span>,</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;        widgetName: name,</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;        widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;        widgetBaseClass: fullName</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;    }, prototype );</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;    $.widget.bridge( name, $[ <span class="keyword">namespace</span> ][ name ] );</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;};</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;$.widget.bridge = <span class="keyword">function</span>( name, object ) {</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    $.fn[ name ] = <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;        var isMethodCall = typeof options === <span class="stringliteral">&quot;string&quot;</span>,</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;            args = Array.prototype.slice.call( arguments, 1 ),</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;            returnValue = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;        <span class="comment">// allow multiple hashes to be passed on init</span></div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;        options = !isMethodCall &amp;&amp; args.length ?</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;            $.extend.apply( null, [ <span class="keyword">true</span>, options ].concat(args) ) :</div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;            options;</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;        <span class="comment">// prevent calls to internal methods</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        <span class="keywordflow">if</span> ( isMethodCall &amp;&amp; options.charAt( 0 ) === <span class="stringliteral">&quot;_&quot;</span> ) {</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;            <span class="keywordflow">return</span> returnValue;</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;        }</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;        <span class="keywordflow">if</span> ( isMethodCall ) {</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;            this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;                var instance = $.data( <span class="keyword">this</span>, name ),</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                    methodValue = instance &amp;&amp; $.isFunction( instance[options] ) ?</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;                        instance[ options ].apply( instance, args ) :</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;                        instance;</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;                <span class="comment">// TODO: add this back in 1.9 and use $.error() (see #5972)</span></div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;<span class="comment">//              if ( !instance ) {</span></div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;<span class="comment">//                  throw &quot;cannot call methods on &quot; + name + &quot; prior to initialization; &quot; +</span></div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;<span class="comment">//                      &quot;attempted to call method &#39;&quot; + options + &quot;&#39;&quot;;</span></div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;<span class="comment">//              }</span></div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;<span class="comment">//              if ( !$.isFunction( instance[options] ) ) {</span></div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;<span class="comment">//                  throw &quot;no such method &#39;&quot; + options + &quot;&#39; for &quot; + name + &quot; widget instance&quot;;</span></div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;<span class="comment">//              }</span></div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;<span class="comment">//              var methodValue = instance[ options ].apply( instance, args );</span></div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;                <span class="keywordflow">if</span> ( methodValue !== instance &amp;&amp; methodValue !== undefined ) {</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;                    returnValue = methodValue;</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;                }</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;            });</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;            this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;                var instance = $.data( <span class="keyword">this</span>, name );</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;                <span class="keywordflow">if</span> ( instance ) {</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;                    instance.option( options || {} )._init();</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;                    $.data( <span class="keyword">this</span>, name, <span class="keyword">new</span> <span class="keywordtype">object</span>( options, <span class="keyword">this</span> ) );</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;                }</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;            });</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;        }</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;        <span class="keywordflow">return</span> returnValue;</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    };</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;};</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;$.Widget = <span class="keyword">function</span>( options, element ) {</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    <span class="comment">// allow instantiation without initializing for simple inheritance</span></div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;    <span class="keywordflow">if</span> ( arguments.length ) {</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;        this._createWidget( options, element );</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    }</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;};</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;$.Widget.prototype = {</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    widgetName: <span class="stringliteral">&quot;widget&quot;</span>,</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;    widgetEventPrefix: <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;    options: {</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;        disabled: <span class="keyword">false</span></div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    },</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;    _createWidget: <span class="keyword">function</span>( options, element ) {</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;        <span class="comment">// $.widget.bridge stores the plugin instance, but we do it anyway</span></div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;        <span class="comment">// so that it&#39;s stored even before the _create function runs</span></div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;        $.data( element, this.widgetName, <span class="keyword">this</span> );</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;        this.element = $( element );</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;        this.options = $.extend( <span class="keyword">true</span>, {},</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;            this.options,</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;            this._getCreateOptions(),</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;            options );</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;        this.element.bind( <span class="stringliteral">&quot;remove.&quot;</span> + this.widgetName, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;            <span class="keyword">self</span>.destroy();</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;        });</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;        this._create();</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;        this._trigger( <span class="stringliteral">&quot;create&quot;</span> );</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;        this._init();</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    },</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;    _getCreateOptions: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;        <span class="keywordflow">return</span> $.metadata &amp;&amp; $.metadata.get( this.element[0] )[ this.widgetName ];</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;    },</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    _create: <span class="keyword">function</span>() {},</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;    _init: <span class="keyword">function</span>() {},</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;        this.element</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;            .unbind( <span class="stringliteral">&quot;.&quot;</span> + this.widgetName )</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;            .removeData( this.widgetName );</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;        this.widget()</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;            .unbind( <span class="stringliteral">&quot;.&quot;</span> + this.widgetName )</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-disabled&quot;</span> )</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;            .removeClass(</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;                this.widgetBaseClass + <span class="stringliteral">&quot;-disabled &quot;</span> +</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;                <span class="stringliteral">&quot;ui-state-disabled&quot;</span> );</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;    },</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;    widget: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;        <span class="keywordflow">return</span> this.element;</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;    },</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    option: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;        var options = key;</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;        <span class="keywordflow">if</span> ( arguments.length === 0 ) {</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;            <span class="comment">// don&#39;t return a reference to the internal hash</span></div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;            <span class="keywordflow">return</span> $.extend( {}, this.options );</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;        }</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;</div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;        <span class="keywordflow">if</span>  (typeof key === <span class="stringliteral">&quot;string&quot;</span> ) {</div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;            <span class="keywordflow">if</span> ( value === undefined ) {</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;                <span class="keywordflow">return</span> this.options[ key ];</div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;            }</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;            options = {};</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;            options[ key ] = value;</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;        }</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;        this._setOptions( options );</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;    },</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;    _setOptions: <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;        $.each( options, <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;            <span class="keyword">self</span>._setOption( key, value );</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;        });</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;    },</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;        this.options[ key ] = value;</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;disabled&quot;</span> ) {</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;            this.widget()</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;                [ value ? <span class="stringliteral">&quot;addClass&quot;</span> : <span class="stringliteral">&quot;removeClass&quot;</span>](</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;                    this.widgetBaseClass + <span class="stringliteral">&quot;-disabled&quot;</span> + <span class="stringliteral">&quot; &quot;</span> +</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;                    <span class="stringliteral">&quot;ui-state-disabled&quot;</span> )</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;                .attr( <span class="stringliteral">&quot;aria-disabled&quot;</span>, value );</div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;        }</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;    },</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;    enable: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;        <span class="keywordflow">return</span> this._setOption( <span class="stringliteral">&quot;disabled&quot;</span>, <span class="keyword">false</span> );</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;    },</div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;    disable: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;        <span class="keywordflow">return</span> this._setOption( <span class="stringliteral">&quot;disabled&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;    },</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;    _trigger: <span class="keyword">function</span>( type, event, data ) {</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;        var prop, orig,</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;            callback = this.options[ type ];</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;        data = data || {};</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;        <span class="keyword">event</span> = $.Event( event );</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;        <span class="keyword">event</span>.type = ( type === this.widgetEventPrefix ?</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;            type :</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;            this.widgetEventPrefix + type ).toLowerCase();</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;        <span class="comment">// the original event may come from any element</span></div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;        <span class="comment">// so we need to reset the target on the new event</span></div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;        <span class="keyword">event</span>.target = this.element[ 0 ];</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;        <span class="comment">// copy original event properties over to the new event</span></div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;        orig = <span class="keyword">event</span>.originalEvent;</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;        <span class="keywordflow">if</span> ( orig ) {</div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;            <span class="keywordflow">for</span> ( prop in orig ) {</div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;                <span class="keywordflow">if</span> ( !( prop in event ) ) {</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;                    <span class="keyword">event</span>[ prop ] = orig[ prop ];</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;                }</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;            }</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;        }</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;        this.element.trigger( event, data );</div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;        <span class="keywordflow">return</span> !( $.isFunction(callback) &amp;&amp;</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;            callback.call( this.element[0], event, data ) === <span class="keyword">false</span> ||</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;            <span class="keyword">event</span>.isDefaultPrevented() );</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;    }</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;};</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;})( jQuery );</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;var mouseHandled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;$( document ).mouseup( <span class="keyword">function</span>( e ) {</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;    mouseHandled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;});</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;$.widget(<span class="stringliteral">&quot;ui.mouse&quot;</span>, {</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;    options: {</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;        cancel: <span class="stringliteral">&#39;:input,option&#39;</span>,</div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;        distance: 1,</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;        delay: 0</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;    },</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;    _mouseInit: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;        this.element</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;            .bind(<span class="stringliteral">&#39;mousedown.&#39;</span>+this.widgetName, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">self</span>._mouseDown(event);</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;            })</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;            .bind(<span class="stringliteral">&#39;click.&#39;</span>+this.widgetName, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;                <span class="keywordflow">if</span> (<span class="keyword">true</span> === $.data(event.target, <span class="keyword">self</span>.widgetName + <span class="stringliteral">&#39;.preventClickEvent&#39;</span>)) {</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;                    $.removeData(event.target, <span class="keyword">self</span>.widgetName + <span class="stringliteral">&#39;.preventClickEvent&#39;</span>);</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;                    <span class="keyword">event</span>.stopImmediatePropagation();</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;                }</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;            });</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;        this.started = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;    },</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;    <span class="comment">// TODO: make sure destroying one instance of mouse doesn&#39;t mess with</span></div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;    <span class="comment">// other instances of mouse</span></div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;    _mouseDestroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;        this.element.unbind(<span class="charliteral">&#39;.&#39;</span>+this.widgetName);</div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;        $(document)</div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;            .unbind(<span class="stringliteral">&#39;mousemove.&#39;</span>+this.widgetName, this._mouseMoveDelegate)</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;            .unbind(<span class="stringliteral">&#39;mouseup.&#39;</span>+this.widgetName, this._mouseUpDelegate);</div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    },</div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;</div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;    _mouseDown: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;        <span class="comment">// don&#39;t let more than one widget handle mouseStart</span></div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;        <span class="keywordflow">if</span>( mouseHandled ) { <span class="keywordflow">return</span> };</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;        <span class="comment">// we may have missed mouseup (out of window)</span></div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;        (this._mouseStarted &amp;&amp; this._mouseUp(event));</div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;        this._mouseDownEvent = event;</div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;</div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;            btnIsLeft = (<span class="keyword">event</span>.which == 1),</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;            <span class="comment">// event.target.nodeName works around a bug in IE 8 with</span></div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;            <span class="comment">// disabled inputs (#7620)</span></div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;            elIsCancel = (typeof this.options.cancel == <span class="stringliteral">&quot;string&quot;</span> &amp;&amp; event.target.nodeName ? $(event.target).closest(this.options.cancel).length : <span class="keyword">false</span>);</div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;        <span class="keywordflow">if</span> (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {</div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;        }</div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;</div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;        this.mouseDelayMet = !this.options.delay;</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;        <span class="keywordflow">if</span> (!this.mouseDelayMet) {</div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;            this._mouseDelayTimer = setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;                <span class="keyword">self</span>.mouseDelayMet = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;            }, this.options.delay);</div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;        }</div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;        <span class="keywordflow">if</span> (this._mouseDistanceMet(event) &amp;&amp; this._mouseDelayMet(event)) {</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;            this._mouseStarted = (this._mouseStart(event) !== <span class="keyword">false</span>);</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;            <span class="keywordflow">if</span> (!this._mouseStarted) {</div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;                <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;            }</div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;        }</div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;        <span class="comment">// Click event may never have fired (Gecko &amp; Opera)</span></div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">true</span> === $.data(event.target, <span class="keyword">this</span>.widgetName + <span class="stringliteral">&#39;.preventClickEvent&#39;</span>)) {</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;            $.removeData(event.target, <span class="keyword">this</span>.widgetName + <span class="stringliteral">&#39;.preventClickEvent&#39;</span>);</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;        }</div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;</div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;        <span class="comment">// these delegates are required to keep context</span></div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;        this._mouseMoveDelegate = <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">self</span>._mouseMove(event);</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;        };</div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;        this._mouseUpDelegate = <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">self</span>._mouseUp(event);</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;        };</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;        $(document)</div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;            .bind(<span class="stringliteral">&#39;mousemove.&#39;</span>+this.widgetName, this._mouseMoveDelegate)</div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;            .bind(<span class="stringliteral">&#39;mouseup.&#39;</span>+this.widgetName, this._mouseUpDelegate);</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;</div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;        <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;        </div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;        mouseHandled = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;    },</div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;    _mouseMove: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;        <span class="comment">// IE mouseup check - mouseup happened when mouse was out of window</span></div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;        <span class="keywordflow">if</span> ($.browser.msie &amp;&amp; !(document.documentMode &gt;= 9) &amp;&amp; !<span class="keyword">event</span>.button) {</div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;            <span class="keywordflow">return</span> this._mouseUp(event);</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;        }</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;        <span class="keywordflow">if</span> (this._mouseStarted) {</div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;            this._mouseDrag(event);</div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;        }</div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;</div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;        <span class="keywordflow">if</span> (this._mouseDistanceMet(event) &amp;&amp; this._mouseDelayMet(event)) {</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;            this._mouseStarted =</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;                (this._mouseStart(this._mouseDownEvent, event) !== <span class="keyword">false</span>);</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;            (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));</div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;        }</div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;</div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;        <span class="keywordflow">return</span> !this._mouseStarted;</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;    },</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;    _mouseUp: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;        $(document)</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;            .unbind(<span class="stringliteral">&#39;mousemove.&#39;</span>+this.widgetName, this._mouseMoveDelegate)</div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;            .unbind(<span class="stringliteral">&#39;mouseup.&#39;</span>+this.widgetName, this._mouseUpDelegate);</div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;</div>
<div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;        <span class="keywordflow">if</span> (this._mouseStarted) {</div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;            this._mouseStarted = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;            <span class="keywordflow">if</span> (event.target == <span class="keyword">this</span>._mouseDownEvent.target) {</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;                $.data(event.target, <span class="keyword">this</span>.widgetName + <span class="stringliteral">&#39;.preventClickEvent&#39;</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;            }</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;            this._mouseStop(event);</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;        }</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;</div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;    },</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;</div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;    _mouseDistanceMet: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;        <span class="keywordflow">return</span> (Math.max(</div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;                Math.abs(<span class="keyword">this</span>._mouseDownEvent.pageX - event.pageX),</div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;                Math.abs(this._mouseDownEvent.pageY - event.pageY)</div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;            ) &gt;= this.options.distance</div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;        );</div>
<div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;    },</div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;</div>
<div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;    _mouseDelayMet: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;        <span class="keywordflow">return</span> this.mouseDelayMet;</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;    },</div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;    <span class="comment">// These are placeholder methods, to be overriden by extending plugin</span></div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;    _mouseStart: <span class="keyword">function</span>(event) {},</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    _mouseDrag: <span class="keyword">function</span>(event) {},</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;    _mouseStop: <span class="keyword">function</span>(event) {},</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;    _mouseCapture: <span class="keyword">function</span>(event) { <span class="keywordflow">return</span> <span class="keyword">true</span>; }</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;});</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;})(jQuery);</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;$.widget(<span class="stringliteral">&quot;ui.draggable&quot;</span>, $.ui.mouse, {</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;    widgetEventPrefix: <span class="stringliteral">&quot;drag&quot;</span>,</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    options: {</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;        addClasses: <span class="keyword">true</span>,</div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;        appendTo: <span class="stringliteral">&quot;parent&quot;</span>,</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;        axis: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;        connectToSortable: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;        containment: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;        cursor: <span class="stringliteral">&quot;auto&quot;</span>,</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;        cursorAt: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;        grid: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;        handle: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;        helper: <span class="stringliteral">&quot;original&quot;</span>,</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;        iframeFix: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;        opacity: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;        refreshPositions: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;        revert: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;        revertDuration: 500,</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;        scope: <span class="stringliteral">&quot;default&quot;</span>,</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;        scroll: <span class="keyword">true</span>,</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;        scrollSensitivity: 20,</div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;        scrollSpeed: 20,</div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;        snap: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;        snapMode: <span class="stringliteral">&quot;both&quot;</span>,</div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;        snapTolerance: 20,</div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;        stack: <span class="keyword">false</span>,</div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;        zIndex: <span class="keyword">false</span></div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;    },</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;        <span class="keywordflow">if</span> (this.options.helper == <span class="stringliteral">&#39;original&#39;</span> &amp;&amp; !(/^(?:r|a|f)/).test(<span class="keyword">this</span>.element.css(<span class="stringliteral">&quot;position&quot;</span>)))</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;            this.element[0].style.position = <span class="stringliteral">&#39;relative&#39;</span>;</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;        (this.options.addClasses &amp;&amp; this.element.addClass(<span class="stringliteral">&quot;ui-draggable&quot;</span>));</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;        (this.options.disabled &amp;&amp; this.element.addClass(<span class="stringliteral">&quot;ui-draggable-disabled&quot;</span>));</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;        this._mouseInit();</div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;</div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;    },</div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;</div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;        <span class="keywordflow">if</span>(!this.element.data(<span class="stringliteral">&#39;draggable&#39;</span>)) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;        this.element</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;            .removeData(<span class="stringliteral">&quot;draggable&quot;</span>)</div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;            .unbind(<span class="stringliteral">&quot;.draggable&quot;</span>)</div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;            .removeClass(<span class="stringliteral">&quot;ui-draggable&quot;</span></div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;                + <span class="stringliteral">&quot; ui-draggable-dragging&quot;</span></div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;                + <span class="stringliteral">&quot; ui-draggable-disabled&quot;</span>);</div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;        this._mouseDestroy();</div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;    },</div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;</div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;    _mouseCapture: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;</div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;</div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;        <span class="comment">// among others, prevent a drag on a resizable-handle</span></div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;        <span class="keywordflow">if</span> (this.helper || o.disabled || $(event.target).is(<span class="stringliteral">&#39;.ui-resizable-handle&#39;</span>))</div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;</div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;        <span class="comment">//Quit if we&#39;re not on a valid handle</span></div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;        this.handle = this._getHandle(event);</div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;        <span class="keywordflow">if</span> (!this.handle)</div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;        </div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;        <span class="keywordflow">if</span> ( o.iframeFix ) {</div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;            $(o.iframeFix === <span class="keyword">true</span> ? <span class="stringliteral">&quot;iframe&quot;</span> : o.iframeFix).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;                $(<span class="stringliteral">&#39;&lt;div class=&quot;ui-draggable-iframeFix&quot; style=&quot;background: #fff;&quot;&gt;&lt;/div&gt;&#39;</span>)</div>
<div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;                .css({</div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;                    width: this.offsetWidth+<span class="stringliteral">&quot;px&quot;</span>, height: this.offsetHeight+<span class="stringliteral">&quot;px&quot;</span>,</div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160;                    position: <span class="stringliteral">&quot;absolute&quot;</span>, opacity: <span class="stringliteral">&quot;0.001&quot;</span>, zIndex: 1000</div>
<div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;                })</div>
<div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;                .css($(<span class="keyword">this</span>).offset())</div>
<div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;                .appendTo(<span class="stringliteral">&quot;body&quot;</span>);</div>
<div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;            });</div>
<div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160;        }</div>
<div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160;</div>
<div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;</div>
<div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;    },</div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;</div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;    _mouseStart: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;</div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;</div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;        <span class="comment">//Create and append the visible helper</span></div>
<div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;        this.helper = this._createHelper(event);</div>
<div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;</div>
<div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160;        <span class="comment">//Cache the helper size</span></div>
<div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;        this._cacheHelperProportions();</div>
<div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160;</div>
<div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;        <span class="comment">//If ddmanager is used for droppables, set the global draggable</span></div>
<div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;        <span class="keywordflow">if</span>($.ui.ddmanager)</div>
<div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160;            $.ui.ddmanager.current = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;</div>
<div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;<span class="comment">         * - Position generation -</span></div>
<div class="line"><a name="l00835"></a><span class="lineno">  835</span>&#160;<span class="comment">         * This block generates everything position related - it&#39;s the core of draggables.</span></div>
<div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160;</div>
<div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;        <span class="comment">//Cache the margins of the original element</span></div>
<div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;        this._cacheMargins();</div>
<div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160;</div>
<div class="line"><a name="l00841"></a><span class="lineno">  841</span>&#160;        <span class="comment">//Store the helper&#39;s css position</span></div>
<div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;        this.cssPosition = this.helper.css(<span class="stringliteral">&quot;position&quot;</span>);</div>
<div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160;        this.scrollParent = this.helper.scrollParent();</div>
<div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;</div>
<div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;        <span class="comment">//The element&#39;s absolute position on the page minus margins</span></div>
<div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;        this.offset = this.positionAbs = this.element.offset();</div>
<div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160;        this.offset = {</div>
<div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;            top: this.offset.top - this.margins.top,</div>
<div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160;            left: this.offset.left - this.margins.left</div>
<div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;        };</div>
<div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;</div>
<div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;        $.extend(this.offset, {</div>
<div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;            click: { <span class="comment">//Where the click happened, relative to the element</span></div>
<div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;                left: <span class="keyword">event</span>.pageX - this.offset.left,</div>
<div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;                top: <span class="keyword">event</span>.pageY - this.offset.top</div>
<div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160;            },</div>
<div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160;            parent: this._getParentOffset(),</div>
<div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160;            relative: this._getRelativeOffset() <span class="comment">//This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper</span></div>
<div class="line"><a name="l00859"></a><span class="lineno">  859</span>&#160;        });</div>
<div class="line"><a name="l00860"></a><span class="lineno">  860</span>&#160;</div>
<div class="line"><a name="l00861"></a><span class="lineno">  861</span>&#160;        <span class="comment">//Generate the original position</span></div>
<div class="line"><a name="l00862"></a><span class="lineno">  862</span>&#160;        this.originalPosition = this.position = this._generatePosition(event);</div>
<div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;        this.originalPageX = <span class="keyword">event</span>.pageX;</div>
<div class="line"><a name="l00864"></a><span class="lineno">  864</span>&#160;        this.originalPageY = <span class="keyword">event</span>.pageY;</div>
<div class="line"><a name="l00865"></a><span class="lineno">  865</span>&#160;</div>
<div class="line"><a name="l00866"></a><span class="lineno">  866</span>&#160;        <span class="comment">//Adjust the mouse offset relative to the helper if &#39;cursorAt&#39; is supplied</span></div>
<div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160;        (o.cursorAt &amp;&amp; this._adjustOffsetFromHelper(o.cursorAt));</div>
<div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;</div>
<div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;        <span class="comment">//Set a containment if given in the options</span></div>
<div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;        <span class="keywordflow">if</span>(o.containment)</div>
<div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160;            this._setContainment();</div>
<div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;</div>
<div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;        <span class="comment">//Trigger event + callbacks</span></div>
<div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;        <span class="keywordflow">if</span>(this._trigger(<span class="stringliteral">&quot;start&quot;</span>, event) === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;            this._clear();</div>
<div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160;        }</div>
<div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;</div>
<div class="line"><a name="l00879"></a><span class="lineno">  879</span>&#160;        <span class="comment">//Recache the helper size</span></div>
<div class="line"><a name="l00880"></a><span class="lineno">  880</span>&#160;        this._cacheHelperProportions();</div>
<div class="line"><a name="l00881"></a><span class="lineno">  881</span>&#160;</div>
<div class="line"><a name="l00882"></a><span class="lineno">  882</span>&#160;        <span class="comment">//Prepare the droppable offsets</span></div>
<div class="line"><a name="l00883"></a><span class="lineno">  883</span>&#160;        <span class="keywordflow">if</span> ($.ui.ddmanager &amp;&amp; !o.dropBehaviour)</div>
<div class="line"><a name="l00884"></a><span class="lineno">  884</span>&#160;            $.ui.ddmanager.prepareOffsets(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l00885"></a><span class="lineno">  885</span>&#160;</div>
<div class="line"><a name="l00886"></a><span class="lineno">  886</span>&#160;        this.helper.addClass(<span class="stringliteral">&quot;ui-draggable-dragging&quot;</span>);</div>
<div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;        this._mouseDrag(event, <span class="keyword">true</span>); <span class="comment">//Execute the drag once - this causes the helper not to be visible before getting its correct position</span></div>
<div class="line"><a name="l00888"></a><span class="lineno">  888</span>&#160;        </div>
<div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;        <span class="comment">//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)</span></div>
<div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;        <span class="keywordflow">if</span> ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160;        </div>
<div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;    },</div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160;</div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;    _mouseDrag: <span class="keyword">function</span>(event, noPropagation) {</div>
<div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160;</div>
<div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160;        <span class="comment">//Compute the helpers position</span></div>
<div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;        this.position = this._generatePosition(event);</div>
<div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;        this.positionAbs = this._convertPositionTo(<span class="stringliteral">&quot;absolute&quot;</span>);</div>
<div class="line"><a name="l00900"></a><span class="lineno">  900</span>&#160;</div>
<div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;        <span class="comment">//Call plugins and callbacks and use the resulting position if something is returned</span></div>
<div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;        <span class="keywordflow">if</span> (!noPropagation) {</div>
<div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;            var ui = this._uiHash();</div>
<div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;            <span class="keywordflow">if</span>(this._trigger(<span class="stringliteral">&#39;drag&#39;</span>, event, ui) === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;                this._mouseUp({});</div>
<div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00907"></a><span class="lineno">  907</span>&#160;            }</div>
<div class="line"><a name="l00908"></a><span class="lineno">  908</span>&#160;            this.position = ui.position;</div>
<div class="line"><a name="l00909"></a><span class="lineno">  909</span>&#160;        }</div>
<div class="line"><a name="l00910"></a><span class="lineno">  910</span>&#160;</div>
<div class="line"><a name="l00911"></a><span class="lineno">  911</span>&#160;        <span class="keywordflow">if</span>(!this.options.axis || <span class="keyword">this</span>.options.axis != <span class="stringliteral">&quot;y&quot;</span>) this.helper[0].style.left = this.position.left+<span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l00912"></a><span class="lineno">  912</span>&#160;        <span class="keywordflow">if</span>(!this.options.axis || <span class="keyword">this</span>.options.axis != <span class="stringliteral">&quot;x&quot;</span>) this.helper[0].style.top = this.position.top+<span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l00913"></a><span class="lineno">  913</span>&#160;        <span class="keywordflow">if</span>($.ui.ddmanager) $.ui.ddmanager.drag(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l00914"></a><span class="lineno">  914</span>&#160;</div>
<div class="line"><a name="l00915"></a><span class="lineno">  915</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00916"></a><span class="lineno">  916</span>&#160;    },</div>
<div class="line"><a name="l00917"></a><span class="lineno">  917</span>&#160;</div>
<div class="line"><a name="l00918"></a><span class="lineno">  918</span>&#160;    _mouseStop: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;</div>
<div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;        <span class="comment">//If we are using droppables, inform the manager about the drop</span></div>
<div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160;        var dropped = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;        <span class="keywordflow">if</span> ($.ui.ddmanager &amp;&amp; !<span class="keyword">this</span>.options.dropBehaviour)</div>
<div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;            dropped = $.ui.ddmanager.drop(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;</div>
<div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;        <span class="comment">//if a drop comes from outside (a sortable)</span></div>
<div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;        <span class="keywordflow">if</span>(this.dropped) {</div>
<div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;            dropped = this.dropped;</div>
<div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;            this.dropped = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;        }</div>
<div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160;        </div>
<div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;        <span class="comment">//if the original element is no longer in the DOM don&#39;t bother to continue (see #8269)</span></div>
<div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;        var element = this.element[0], elementInDom = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;        <span class="keywordflow">while</span> ( element &amp;&amp; (element = element.parentNode) ) {</div>
<div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;            <span class="keywordflow">if</span> (element == document ) {</div>
<div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160;                elementInDom = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;            }</div>
<div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;        }</div>
<div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;        <span class="keywordflow">if</span> ( !elementInDom &amp;&amp; this.options.helper === <span class="stringliteral">&quot;original&quot;</span> )</div>
<div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;</div>
<div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;        <span class="keywordflow">if</span>((this.options.revert == <span class="stringliteral">&quot;invalid&quot;</span> &amp;&amp; !dropped) || (<span class="keyword">this</span>.options.revert == <span class="stringliteral">&quot;valid&quot;</span> &amp;&amp; dropped) || <span class="keyword">this</span>.options.revert === <span class="keyword">true</span> || ($.isFunction(<span class="keyword">this</span>.options.revert) &amp;&amp; this.options.revert.call(this.element, dropped))) {</div>
<div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;            var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;            $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;                <span class="keywordflow">if</span>(<span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;stop&quot;</span>, event) !== <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;                    <span class="keyword">self</span>._clear();</div>
<div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;                }</div>
<div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;            });</div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;            <span class="keywordflow">if</span>(this._trigger(<span class="stringliteral">&quot;stop&quot;</span>, event) !== <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;                this._clear();</div>
<div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;            }</div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;        }</div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;</div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;    },</div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;    </div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;    _mouseUp: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;        <span class="keywordflow">if</span> (this.options.iframeFix === <span class="keyword">true</span>) {</div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;            $(<span class="stringliteral">&quot;div.ui-draggable-iframeFix&quot;</span>).each(<span class="keyword">function</span>() { </div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;                this.parentNode.removeChild(<span class="keyword">this</span>); </div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;            }); <span class="comment">//Remove frame helpers</span></div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;        }</div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;        </div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;        <span class="comment">//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)</span></div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;        <span class="keywordflow">if</span>( $.ui.ddmanager ) $.ui.ddmanager.dragStop(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;        </div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;        <span class="keywordflow">return</span> $.ui.mouse.prototype._mouseUp.call(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;    },</div>
<div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;    </div>
<div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;    cancel: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160;        </div>
<div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;        <span class="keywordflow">if</span>(this.helper.is(<span class="stringliteral">&quot;.ui-draggable-dragging&quot;</span>)) {</div>
<div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160;            this._mouseUp({});</div>
<div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160;            this._clear();</div>
<div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160;        }</div>
<div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160;        </div>
<div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;        </div>
<div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;    },</div>
<div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;</div>
<div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;    _getHandle: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;</div>
<div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160;        var handle = !this.options.handle || !$(this.options.handle, this.element).length ? <span class="keyword">true</span> : <span class="keyword">false</span>;</div>
<div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160;        $(this.options.handle, this.element)</div>
<div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;            .find(<span class="stringliteral">&quot;*&quot;</span>)</div>
<div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160;            .andSelf()</div>
<div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;            .each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;                <span class="keywordflow">if</span>(<span class="keyword">this</span> == event.target) handle = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;            });</div>
<div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160;</div>
<div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160;        <span class="keywordflow">return</span> handle;</div>
<div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;</div>
<div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;    },</div>
<div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;</div>
<div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;    _createHelper: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;</div>
<div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;        var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == <span class="stringliteral">&#39;clone&#39;</span> ? <span class="keyword">this</span>.element.clone().removeAttr(<span class="stringliteral">&#39;id&#39;</span>) : this.element);</div>
<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160;</div>
<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160;        <span class="keywordflow">if</span>(!helper.parents(<span class="stringliteral">&#39;body&#39;</span>).length)</div>
<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>&#160;            helper.appendTo((o.appendTo == <span class="stringliteral">&#39;parent&#39;</span> ? <span class="keyword">this</span>.element[0].parentNode : o.appendTo));</div>
<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160;</div>
<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160;        <span class="keywordflow">if</span>(helper[0] != this.element[0] &amp;&amp; !(/(fixed|absolute)/).test(helper.css(<span class="stringliteral">&quot;position&quot;</span>)))</div>
<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;            helper.css(<span class="stringliteral">&quot;position&quot;</span>, <span class="stringliteral">&quot;absolute&quot;</span>);</div>
<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160;</div>
<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;        <span class="keywordflow">return</span> helper;</div>
<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;    },</div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160;</div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;    _adjustOffsetFromHelper: <span class="keyword">function</span>(obj) {</div>
<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160;        <span class="keywordflow">if</span> (typeof obj == <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;            obj = obj.split(<span class="charliteral">&#39; &#39;</span>);</div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;        }</div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;        <span class="keywordflow">if</span> ($.isArray(obj)) {</div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;            obj = {left: +obj[0], top: +obj[1] || 0};</div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;        }</div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;left&#39;</span> in obj) {</div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;            this.offset.click.left = obj.left + this.margins.left;</div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;        }</div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;right&#39;</span> in obj) {</div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;            this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;</div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;        }</div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;top&#39;</span> in obj) {</div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;            this.offset.click.top = obj.top + this.margins.top;</div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;        }</div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;bottom&#39;</span> in obj) {</div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;            this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;</div>
<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;        }</div>
<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160;    },</div>
<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160;</div>
<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160;    _getParentOffset: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160;</div>
<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160;        <span class="comment">//Get the offsetParent and cache its position</span></div>
<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160;        this.offsetParent = this.helper.offsetParent();</div>
<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160;        var po = this.offsetParent.offset();</div>
<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160;</div>
<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160;        <span class="comment">// This is a special case where we need to modify a offset calculated on start, since the following happened:</span></div>
<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160;        <span class="comment">// 1. The position of the helper is absolute, so it&#39;s position is calculated based on the next positioned parent</span></div>
<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;        <span class="comment">// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn&#39;t the document, which means that</span></div>
<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;        <span class="comment">//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag</span></div>
<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160;        <span class="keywordflow">if</span>(this.cssPosition == <span class="stringliteral">&#39;absolute&#39;</span> &amp;&amp; this.scrollParent[0] != document &amp;&amp; $.ui.contains(<span class="keyword">this</span>.scrollParent[0], <span class="keyword">this</span>.offsetParent[0])) {</div>
<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160;            po.left += this.scrollParent.scrollLeft();</div>
<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;            po.top += this.scrollParent.scrollTop();</div>
<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160;        }</div>
<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160;</div>
<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;        <span class="keywordflow">if</span>((this.offsetParent[0] == document.body) <span class="comment">//This needs to be actually done for all browsers, since pageX/pageY includes this information</span></div>
<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;        || (<span class="keyword">this</span>.offsetParent[0].tagName &amp;&amp; <span class="keyword">this</span>.offsetParent[0].tagName.toLowerCase() == <span class="stringliteral">&#39;html&#39;</span> &amp;&amp; $.browser.msie)) <span class="comment">//Ugly IE fix</span></div>
<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160;            po = { top: 0, left: 0 };</div>
<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;</div>
<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;            top: po.top + (parseInt(this.offsetParent.css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>),10) || 0),</div>
<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;            left: po.left + (parseInt(this.offsetParent.css(<span class="stringliteral">&quot;borderLeftWidth&quot;</span>),10) || 0)</div>
<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;        };</div>
<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160;</div>
<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160;    },</div>
<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160;</div>
<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160;    _getRelativeOffset: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>&#160;</div>
<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>&#160;        <span class="keywordflow">if</span>(this.cssPosition == <span class="stringliteral">&quot;relative&quot;</span>) {</div>
<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>&#160;            var p = this.element.position();</div>
<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>&#160;            <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>&#160;                top: p.top - (parseInt(this.helper.css(<span class="stringliteral">&quot;top&quot;</span>),10) || 0) + this.scrollParent.scrollTop(),</div>
<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>&#160;                left: p.left - (parseInt(this.helper.css(<span class="stringliteral">&quot;left&quot;</span>),10) || 0) + this.scrollParent.scrollLeft()</div>
<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>&#160;            };</div>
<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>&#160;            <span class="keywordflow">return</span> { top: 0, left: 0 };</div>
<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>&#160;        }</div>
<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>&#160;</div>
<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>&#160;    },</div>
<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>&#160;</div>
<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>&#160;    _cacheMargins: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>&#160;        this.margins = {</div>
<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>&#160;            left: (parseInt(this.element.css(<span class="stringliteral">&quot;marginLeft&quot;</span>),10) || 0),</div>
<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>&#160;            top: (parseInt(this.element.css(<span class="stringliteral">&quot;marginTop&quot;</span>),10) || 0),</div>
<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>&#160;            right: (parseInt(this.element.css(<span class="stringliteral">&quot;marginRight&quot;</span>),10) || 0),</div>
<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>&#160;            bottom: (parseInt(this.element.css(<span class="stringliteral">&quot;marginBottom&quot;</span>),10) || 0)</div>
<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>&#160;        };</div>
<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>&#160;    },</div>
<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>&#160;</div>
<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>&#160;    _cacheHelperProportions: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>&#160;        this.helperProportions = {</div>
<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>&#160;            width: this.helper.outerWidth(),</div>
<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>&#160;            height: this.helper.outerHeight()</div>
<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>&#160;        };</div>
<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>&#160;    },</div>
<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>&#160;</div>
<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>&#160;    _setContainment: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>&#160;</div>
<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>&#160;        <span class="keywordflow">if</span>(o.containment == <span class="stringliteral">&#39;parent&#39;</span>) o.containment = this.helper[0].parentNode;</div>
<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>&#160;        <span class="keywordflow">if</span>(o.containment == <span class="stringliteral">&#39;document&#39;</span> || o.containment == <span class="stringliteral">&#39;window&#39;</span>) this.containment = [</div>
<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>&#160;            o.containment == <span class="stringliteral">&#39;document&#39;</span> ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,</div>
<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>&#160;            o.containment == <span class="stringliteral">&#39;document&#39;</span> ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,</div>
<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>&#160;            (o.containment == <span class="stringliteral">&#39;document&#39;</span> ? 0 : $(window).scrollLeft()) + $(o.containment == <span class="stringliteral">&#39;document&#39;</span> ? document : window).width() - this.helperProportions.width - this.margins.left,</div>
<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>&#160;            (o.containment == <span class="stringliteral">&#39;document&#39;</span> ? 0 : $(window).scrollTop()) + ($(o.containment == <span class="stringliteral">&#39;document&#39;</span> ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - <span class="keyword">this</span>.margins.top</div>
<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;        ];</div>
<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;</div>
<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;        <span class="keywordflow">if</span>(!(/^(document|window|parent)$/).test(o.containment) &amp;&amp; o.containment.constructor != Array) {</div>
<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;                var c = $(o.containment);</div>
<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160;            var ce = c[0]; <span class="keywordflow">if</span>(!ce) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160;            var co = c.offset();</div>
<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>&#160;            var over = ($(ce).css(<span class="stringliteral">&quot;overflow&quot;</span>) != <span class="stringliteral">&#39;hidden&#39;</span>);</div>
<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>&#160;</div>
<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>&#160;            this.containment = [</div>
<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>&#160;                (parseInt($(ce).css(<span class="stringliteral">&quot;borderLeftWidth&quot;</span>),10) || 0) + (parseInt($(ce).css(<span class="stringliteral">&quot;paddingLeft&quot;</span>),10) || 0),</div>
<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>&#160;                (parseInt($(ce).css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>),10) || 0) + (parseInt($(ce).css(<span class="stringliteral">&quot;paddingTop&quot;</span>),10) || 0),</div>
<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>&#160;                (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(<span class="stringliteral">&quot;borderLeftWidth&quot;</span>),10) || 0) - (parseInt($(ce).css(<span class="stringliteral">&quot;paddingRight&quot;</span>),10) || 0) - this.helperProportions.width - <span class="keyword">this</span>.margins.left - <span class="keyword">this</span>.margins.right,</div>
<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>&#160;                (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>),10) || 0) - (parseInt($(ce).css(<span class="stringliteral">&quot;paddingBottom&quot;</span>),10) || 0) - this.helperProportions.height - <span class="keyword">this</span>.margins.top  - <span class="keyword">this</span>.margins.bottom</div>
<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>&#160;            ];</div>
<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>&#160;            <span class="keyword">this</span>.relative_container = c;</div>
<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160;</div>
<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(o.containment.constructor == Array) {</div>
<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>&#160;            this.containment = o.containment;</div>
<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;        }</div>
<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;</div>
<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160;    },</div>
<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160;</div>
<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;    _convertPositionTo: <span class="keyword">function</span>(d, pos) {</div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160;</div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;        <span class="keywordflow">if</span>(!pos) pos = this.position;</div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;        var mod = d == <span class="stringliteral">&quot;absolute&quot;</span> ? 1 : -1;</div>
<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;        var o = this.options, scroll = this.cssPosition == <span class="stringliteral">&#39;absolute&#39;</span> &amp;&amp; !(this.scrollParent[0] != document &amp;&amp; $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);</div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;</div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;            top: (</div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160;                pos.top                                                                 <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;                + this.offset.relative.top * mod                                        <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;                + this.offset.parent.top * mod                                          <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;                - ($.browser.safari &amp;&amp; $.browser.version &lt; 526 &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)</div>
<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160;            ),</div>
<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160;            left: (</div>
<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160;                pos.left                                                                <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>&#160;                + this.offset.relative.left * mod                                       <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>&#160;                + this.offset.parent.left * mod                                         <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>&#160;                - ($.browser.safari &amp;&amp; $.browser.version &lt; 526 &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)</div>
<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>&#160;            )</div>
<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>&#160;        };</div>
<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>&#160;</div>
<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>&#160;    },</div>
<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>&#160;</div>
<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>&#160;    _generatePosition: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>&#160;</div>
<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;        var o = this.options, scroll = this.cssPosition == <span class="stringliteral">&#39;absolute&#39;</span> &amp;&amp; !(this.scrollParent[0] != document &amp;&amp; $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);</div>
<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160;        var pageX = <span class="keyword">event</span>.pageX;</div>
<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;        var pageY = <span class="keyword">event</span>.pageY;</div>
<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160;</div>
<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160;<span class="comment">         * - Position constraining -</span></div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;<span class="comment">         * Constrain the position to a mix of grid, containment.</span></div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160;</div>
<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160;        <span class="keywordflow">if</span>(this.originalPosition) { <span class="comment">//If we are not dragging yet, we won&#39;t check for options</span></div>
<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;                 var containment;</div>
<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160;                 <span class="keywordflow">if</span>(this.containment) {</div>
<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>&#160;                 <span class="keywordflow">if</span> (this.relative_container){</div>
<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>&#160;                     var co = this.relative_container.offset();</div>
<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>&#160;                     containment = [ this.containment[0] + co.left,</div>
<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>&#160;                             this.containment[1] + co.top,</div>
<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>&#160;                             this.containment[2] + co.left,</div>
<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>&#160;                             this.containment[3] + co.top ];</div>
<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160;                 }</div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;                 <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;                     containment = this.containment;</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;                 }</div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160;</div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;                <span class="keywordflow">if</span>(event.pageX - <span class="keyword">this</span>.offset.click.left &lt; containment[0]) pageX = containment[0] + this.offset.click.left;</div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160;                <span class="keywordflow">if</span>(event.pageY - <span class="keyword">this</span>.offset.click.top &lt; containment[1]) pageY = containment[1] + this.offset.click.top;</div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;                <span class="keywordflow">if</span>(event.pageX - <span class="keyword">this</span>.offset.click.left &gt; containment[2]) pageX = containment[2] + this.offset.click.left;</div>
<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>&#160;                <span class="keywordflow">if</span>(event.pageY - <span class="keyword">this</span>.offset.click.top &gt; containment[3]) pageY = containment[3] + this.offset.click.top;</div>
<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;            }</div>
<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160;</div>
<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;            <span class="keywordflow">if</span>(o.grid) {</div>
<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>&#160;                <span class="comment">//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)</span></div>
<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>&#160;                var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;</div>
<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>&#160;                pageY = containment ? (!(top - this.offset.click.top &lt; containment[1] || top - this.offset.click.top &gt; containment[3]) ? top : (!(top - this.offset.click.top &lt; containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;</div>
<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;</div>
<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160;                var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;</div>
<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;                pageX = containment ? (!(left - this.offset.click.left &lt; containment[0] || left - this.offset.click.left &gt; containment[2]) ? left : (!(left - this.offset.click.left &lt; containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;</div>
<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;            }</div>
<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;</div>
<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160;        }</div>
<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160;</div>
<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;            top: (</div>
<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160;                pageY                                                               <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160;                - this.offset.click.top                                                 <span class="comment">// Click offset (relative to the element)</span></div>
<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160;                - this.offset.relative.top                                              <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160;                - this.offset.parent.top                                                <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;                + ($.browser.safari &amp;&amp; $.browser.version &lt; 526 &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))</div>
<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>&#160;            ),</div>
<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>&#160;            left: (</div>
<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;                pageX                                                               <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;                - this.offset.click.left                                                <span class="comment">// Click offset (relative to the element)</span></div>
<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160;                - this.offset.relative.left                                             <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>&#160;                - this.offset.parent.left                                               <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>&#160;                + ($.browser.safari &amp;&amp; $.browser.version &lt; 526 &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))</div>
<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>&#160;            )</div>
<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>&#160;        };</div>
<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>&#160;</div>
<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>&#160;    },</div>
<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>&#160;</div>
<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>&#160;    _clear: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>&#160;        this.helper.removeClass(<span class="stringliteral">&quot;ui-draggable-dragging&quot;</span>);</div>
<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>&#160;        <span class="keywordflow">if</span>(this.helper[0] != this.element[0] &amp;&amp; !this.cancelHelperRemoval) this.helper.remove();</div>
<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>&#160;        <span class="comment">//if($.ui.ddmanager) $.ui.ddmanager.current = null;</span></div>
<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>&#160;        this.helper = null;</div>
<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>&#160;        this.cancelHelperRemoval = <span class="keyword">false</span>;</div>
<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>&#160;    },</div>
<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>&#160;</div>
<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>&#160;    <span class="comment">// From now on bulk stuff - mainly helpers</span></div>
<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>&#160;</div>
<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>&#160;    _trigger: <span class="keyword">function</span>(type, event, ui) {</div>
<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;        ui = ui || this._uiHash();</div>
<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;        $.ui.plugin.call(<span class="keyword">this</span>, type, [event, ui]);</div>
<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;        <span class="keywordflow">if</span>(type == <span class="stringliteral">&quot;drag&quot;</span>) this.positionAbs = this._convertPositionTo(<span class="stringliteral">&quot;absolute&quot;</span>); <span class="comment">//The absolute position has to be recalculated after plugins</span></div>
<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;        <span class="keywordflow">return</span> $.Widget.prototype._trigger.call(<span class="keyword">this</span>, type, event, ui);</div>
<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160;    },</div>
<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160;</div>
<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;    plugins: {},</div>
<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>&#160;</div>
<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;    _uiHash: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;            helper: this.helper,</div>
<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160;            position: this.position,</div>
<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;            originalPosition: this.originalPosition,</div>
<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>&#160;            offset: this.positionAbs</div>
<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;        };</div>
<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>&#160;    }</div>
<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>&#160;</div>
<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>&#160;});</div>
<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160;</div>
<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;$.extend($.ui.draggable, {</div>
<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>&#160;});</div>
<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>&#160;</div>
<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;connectToSortable&quot;</span>, {</div>
<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>&#160;</div>
<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>&#160;        var inst = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>), o = inst.options,</div>
<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>&#160;            uiSortable = $.extend({}, ui, { item: inst.element });</div>
<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>&#160;        inst.sortables = [];</div>
<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>&#160;        $(o.connectToSortable).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>&#160;            var sortable = $.data(<span class="keyword">this</span>, <span class="stringliteral">&#39;sortable&#39;</span>);</div>
<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>&#160;            <span class="keywordflow">if</span> (sortable &amp;&amp; !sortable.options.disabled) {</div>
<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;                inst.sortables.push({</div>
<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;                    instance: sortable,</div>
<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;                    shouldRevert: sortable.options.revert</div>
<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;                });</div>
<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;                sortable.refreshPositions();    <span class="comment">// Call the sortable&#39;s refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it&#39;s initialised as well as being kept in step with any changes that might have happened on the page).</span></div>
<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;                sortable._trigger(<span class="stringliteral">&quot;activate&quot;</span>, event, uiSortable);</div>
<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;            }</div>
<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;        });</div>
<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160;</div>
<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;    },</div>
<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;    stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;</div>
<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;        <span class="comment">//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper</span></div>
<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;        var inst = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>),</div>
<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;            uiSortable = $.extend({}, ui, { item: inst.element });</div>
<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160;</div>
<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160;        $.each(inst.sortables, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;            <span class="keywordflow">if</span>(<span class="keyword">this</span>.instance.isOver) {</div>
<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;</div>
<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>&#160;                <span class="keyword">this</span>.instance.isOver = 0;</div>
<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>&#160;</div>
<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>&#160;                inst.cancelHelperRemoval = <span class="keyword">true</span>; <span class="comment">//Don&#39;t remove the helper in the draggable instance</span></div>
<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>&#160;                <span class="keyword">this</span>.instance.cancelHelperRemoval = <span class="keyword">false</span>; <span class="comment">//Remove it in the sortable instance (so sortable plugins like revert still work)</span></div>
<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>&#160;</div>
<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>&#160;                <span class="comment">//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: &#39;valid/invalid&#39;</span></div>
<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>&#160;                <span class="keywordflow">if</span>(<span class="keyword">this</span>.shouldRevert) <span class="keyword">this</span>.instance.options.revert = <span class="keyword">true</span>;</div>
<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>&#160;</div>
<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>&#160;                <span class="comment">//Trigger the stop of the sortable</span></div>
<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>&#160;                <span class="keyword">this</span>.instance._mouseStop(event);</div>
<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>&#160;</div>
<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>&#160;                this.instance.options.helper = this.instance.options._helper;</div>
<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160;</div>
<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160;                <span class="comment">//If the helper has been the original item, restore properties in the sortable</span></div>
<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;                <span class="keywordflow">if</span>(inst.options.helper == <span class="stringliteral">&#39;original&#39;</span>)</div>
<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;                    this.instance.currentItem.css({ top: <span class="stringliteral">&#39;auto&#39;</span>, left: <span class="stringliteral">&#39;auto&#39;</span> });</div>
<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;</div>
<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160;                this.instance.cancelHelperRemoval = <span class="keyword">false</span>; <span class="comment">//Remove the helper in the sortable instance</span></div>
<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160;                this.instance._trigger(<span class="stringliteral">&quot;deactivate&quot;</span>, event, uiSortable);</div>
<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;            }</div>
<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>&#160;</div>
<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160;        });</div>
<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;</div>
<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160;    },</div>
<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;    drag: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;</div>
<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;        var inst = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>), <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;</div>
<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>&#160;        var checkPos = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;            var dyClick = this.offset.click.top, dxClick = this.offset.click.left;</div>
<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;            var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;</div>
<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>&#160;            var itemHeight = o.height, itemWidth = o.width;</div>
<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>&#160;            var itemTop = o.top, itemLeft = o.left;</div>
<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>&#160;</div>
<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>&#160;            <span class="keywordflow">return</span> $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);</div>
<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>&#160;        };</div>
<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>&#160;</div>
<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>&#160;        $.each(inst.sortables, <span class="keyword">function</span>(i) {</div>
<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>&#160;            </div>
<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>&#160;            <span class="comment">//Copy over some variables to allow calling the sortable&#39;s native _intersectsWith</span></div>
<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>&#160;            <span class="keyword">this</span>.instance.positionAbs = inst.positionAbs;</div>
<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>&#160;            <span class="keyword">this</span>.instance.helperProportions = inst.helperProportions;</div>
<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>&#160;            <span class="keyword">this</span>.instance.offset.click = inst.offset.click;</div>
<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>&#160;            </div>
<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>&#160;            <span class="keywordflow">if</span>(<span class="keyword">this</span>.instance._intersectsWith(<span class="keyword">this</span>.instance.containerCache)) {</div>
<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>&#160;</div>
<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>&#160;                <span class="comment">//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once</span></div>
<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>&#160;                <span class="keywordflow">if</span>(!this.instance.isOver) {</div>
<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>&#160;</div>
<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>&#160;                    this.instance.isOver = 1;</div>
<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>&#160;                    <span class="comment">//Now we fake the start of dragging for the sortable instance,</span></div>
<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;                    <span class="comment">//by cloning the list group item, appending it to the sortable and using it as inst.currentItem</span></div>
<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;                    <span class="comment">//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn&#39;t create a new one)</span></div>
<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160;                    this.instance.currentItem = $(<span class="keyword">self</span>).clone().removeAttr(<span class="stringliteral">&#39;id&#39;</span>).appendTo(this.instance.element).data(<span class="stringliteral">&quot;sortable-item&quot;</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;                    this.instance.options._helper = this.instance.options.helper; <span class="comment">//Store helper option to later restore it</span></div>
<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160;                    this.instance.options.helper = <span class="keyword">function</span>() { <span class="keywordflow">return</span> ui.helper[0]; };</div>
<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;</div>
<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;                    <span class="keyword">event</span>.target = this.instance.currentItem[0];</div>
<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;                    this.instance._mouseCapture(event, <span class="keyword">true</span>);</div>
<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;                    this.instance._mouseStart(event, <span class="keyword">true</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;</div>
<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;                    <span class="comment">//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes</span></div>
<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;                    this.instance.offset.click.top = inst.offset.click.top;</div>
<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;                    this.instance.offset.click.left = inst.offset.click.left;</div>
<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;                    this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;</div>
<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;                    this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;</div>
<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160;</div>
<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;                    inst._trigger(<span class="stringliteral">&quot;toSortable&quot;</span>, event);</div>
<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160;                    inst.dropped = this.instance.element; <span class="comment">//draggable revert needs that</span></div>
<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;                    <span class="comment">//hack so receive/update callbacks work (mostly)</span></div>
<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160;                    inst.currentItem = inst.element;</div>
<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>&#160;                    this.instance.fromOutside = inst;</div>
<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>&#160;</div>
<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>&#160;                }</div>
<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>&#160;</div>
<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>&#160;                <span class="comment">//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable</span></div>
<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>&#160;                <span class="keywordflow">if</span>(this.instance.currentItem) this.instance._mouseDrag(event);</div>
<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>&#160;</div>
<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>&#160;</div>
<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>&#160;                <span class="comment">//If it doesn&#39;t intersect with the sortable, and it intersected before,</span></div>
<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>&#160;                <span class="comment">//we fake the drag stop of the sortable, but make sure it doesn&#39;t remove the helper by using cancelHelperRemoval</span></div>
<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>&#160;                <span class="keywordflow">if</span>(this.instance.isOver) {</div>
<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>&#160;</div>
<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>&#160;                    this.instance.isOver = 0;</div>
<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>&#160;                    this.instance.cancelHelperRemoval = <span class="keyword">true</span>;</div>
<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>&#160;                    </div>
<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>&#160;                    <span class="comment">//Prevent reverting on this forced stop</span></div>
<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>&#160;                    this.instance.options.revert = <span class="keyword">false</span>;</div>
<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>&#160;                    </div>
<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>&#160;                    <span class="comment">// The out event needs to be triggered independently</span></div>
<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>&#160;                    this.instance._trigger(<span class="stringliteral">&#39;out&#39;</span>, event, this.instance._uiHash(<span class="keyword">this</span>.instance));</div>
<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>&#160;                    </div>
<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>&#160;                    this.instance._mouseStop(event, <span class="keyword">true</span>);</div>
<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>&#160;                    this.instance.options.helper = this.instance.options._helper;</div>
<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>&#160;</div>
<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>&#160;                    <span class="comment">//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it&#39;s original size</span></div>
<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>&#160;                    this.instance.currentItem.remove();</div>
<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>&#160;                    <span class="keywordflow">if</span>(this.instance.placeholder) this.instance.placeholder.remove();</div>
<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>&#160;</div>
<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>&#160;                    inst._trigger(<span class="stringliteral">&quot;fromSortable&quot;</span>, event);</div>
<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>&#160;                    inst.dropped = <span class="keyword">false</span>; <span class="comment">//draggable revert needs that</span></div>
<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>&#160;                }</div>
<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>&#160;</div>
<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>&#160;            };</div>
<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>&#160;</div>
<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>&#160;        });</div>
<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>&#160;</div>
<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>&#160;    }</div>
<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>&#160;});</div>
<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>&#160;</div>
<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;cursor&quot;</span>, {</div>
<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>&#160;        var t = $(<span class="stringliteral">&#39;body&#39;</span>), o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&#39;draggable&#39;</span>).options;</div>
<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>&#160;        <span class="keywordflow">if</span> (t.css(<span class="stringliteral">&quot;cursor&quot;</span>)) o._cursor = t.css(<span class="stringliteral">&quot;cursor&quot;</span>);</div>
<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>&#160;        t.css(<span class="stringliteral">&quot;cursor&quot;</span>, o.cursor);</div>
<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160;    },</div>
<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;    stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160;        var o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&#39;draggable&#39;</span>).options;</div>
<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;        <span class="keywordflow">if</span> (o._cursor) $(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&quot;cursor&quot;</span>, o._cursor);</div>
<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160;    }</div>
<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>&#160;});</div>
<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160;</div>
<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;opacity&quot;</span>, {</div>
<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>&#160;        var t = $(ui.helper), o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&#39;draggable&#39;</span>).options;</div>
<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>&#160;        <span class="keywordflow">if</span>(t.css(<span class="stringliteral">&quot;opacity&quot;</span>)) o._opacity = t.css(<span class="stringliteral">&quot;opacity&quot;</span>);</div>
<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>&#160;        t.css(<span class="stringliteral">&#39;opacity&#39;</span>, o.opacity);</div>
<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>&#160;    },</div>
<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>&#160;    stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>&#160;        var o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&#39;draggable&#39;</span>).options;</div>
<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>&#160;        <span class="keywordflow">if</span>(o._opacity) $(ui.helper).css(<span class="stringliteral">&#39;opacity&#39;</span>, o._opacity);</div>
<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>&#160;    }</div>
<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>&#160;});</div>
<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>&#160;</div>
<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;scroll&quot;</span>, {</div>
<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>&#160;        var i = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>);</div>
<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>&#160;        <span class="keywordflow">if</span>(i.scrollParent[0] != document &amp;&amp; i.scrollParent[0].tagName != <span class="stringliteral">&#39;HTML&#39;</span>) i.overflowOffset = i.scrollParent.offset();</div>
<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>&#160;    },</div>
<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>&#160;    drag: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>&#160;</div>
<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>&#160;        var i = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>), o = i.options, scrolled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>&#160;</div>
<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>&#160;        <span class="keywordflow">if</span>(i.scrollParent[0] != document &amp;&amp; i.scrollParent[0].tagName != <span class="stringliteral">&#39;HTML&#39;</span>) {</div>
<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>&#160;</div>
<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>&#160;            <span class="keywordflow">if</span>(!o.axis || o.axis != <span class="charliteral">&#39;x&#39;</span>) {</div>
<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>&#160;                <span class="keywordflow">if</span>((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - <span class="keyword">event</span>.pageY &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>&#160;                    i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;</div>
<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>(event.pageY - i.overflowOffset.top &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>&#160;                    i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;</div>
<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>&#160;            }</div>
<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>&#160;</div>
<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>&#160;            <span class="keywordflow">if</span>(!o.axis || o.axis != <span class="charliteral">&#39;y&#39;</span>) {</div>
<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>&#160;                <span class="keywordflow">if</span>((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - <span class="keyword">event</span>.pageX &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>&#160;                    i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;</div>
<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>(event.pageX - i.overflowOffset.left &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>&#160;                    i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;</div>
<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>&#160;            }</div>
<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>&#160;</div>
<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>&#160;</div>
<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>&#160;            <span class="keywordflow">if</span>(!o.axis || o.axis != <span class="charliteral">&#39;x&#39;</span>) {</div>
<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>&#160;                <span class="keywordflow">if</span>(event.pageY - $(document).scrollTop() &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>&#160;                    scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);</div>
<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>($(window).height() - (event.pageY - $(document).scrollTop()) &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>&#160;                    scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);</div>
<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>&#160;            }</div>
<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>&#160;</div>
<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>&#160;            <span class="keywordflow">if</span>(!o.axis || o.axis != <span class="charliteral">&#39;y&#39;</span>) {</div>
<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>&#160;                <span class="keywordflow">if</span>(event.pageX - $(document).scrollLeft() &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>&#160;                    scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);</div>
<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>($(window).width() - (event.pageX - $(document).scrollLeft()) &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>&#160;                    scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);</div>
<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>&#160;            }</div>
<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>&#160;</div>
<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>&#160;        }</div>
<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>&#160;</div>
<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>&#160;        <span class="keywordflow">if</span>(scrolled !== <span class="keyword">false</span> &amp;&amp; $.ui.ddmanager &amp;&amp; !o.dropBehaviour)</div>
<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>&#160;            $.ui.ddmanager.prepareOffsets(i, event);</div>
<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>&#160;</div>
<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>&#160;    }</div>
<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>&#160;});</div>
<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>&#160;</div>
<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;snap&quot;</span>, {</div>
<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>&#160;</div>
<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>&#160;        var i = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>), o = i.options;</div>
<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>&#160;        i.snapElements = [];</div>
<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>&#160;</div>
<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>&#160;        $(o.snap.constructor != String ? ( o.snap.items || <span class="stringliteral">&#39;:data(draggable)&#39;</span> ) : o.snap).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>&#160;            var $t = $(<span class="keyword">this</span>); var $o = $t.offset();</div>
<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>&#160;            <span class="keywordflow">if</span>(<span class="keyword">this</span> != i.element[0]) i.snapElements.push({</div>
<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>&#160;                item: <span class="keyword">this</span>,</div>
<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>&#160;                width: $t.outerWidth(), height: $t.outerHeight(),</div>
<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>&#160;                top: $o.top, left: $o.left</div>
<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>&#160;            });</div>
<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>&#160;        });</div>
<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>&#160;</div>
<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>&#160;    },</div>
<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>&#160;    drag: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>&#160;</div>
<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>&#160;        var inst = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>), o = inst.options;</div>
<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>&#160;        var d = o.snapTolerance;</div>
<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>&#160;</div>
<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>&#160;        var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,</div>
<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>&#160;            y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;</div>
<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>&#160;</div>
<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>&#160;        <span class="keywordflow">for</span> (var i = inst.snapElements.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>&#160;</div>
<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>&#160;            var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,</div>
<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>&#160;                t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;</div>
<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>&#160;</div>
<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>&#160;            <span class="comment">//Yes, I know, this is insane ;)</span></div>
<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>&#160;            <span class="keywordflow">if</span>(!((l-d &lt; x1 &amp;&amp; x1 &lt; r+d &amp;&amp; t-d &lt; y1 &amp;&amp; y1 &lt; b+d) || (l-d &lt; x1 &amp;&amp; x1 &lt; r+d &amp;&amp; t-d &lt; y2 &amp;&amp; y2 &lt; b+d) || (l-d &lt; x2 &amp;&amp; x2 &lt; r+d &amp;&amp; t-d &lt; y1 &amp;&amp; y1 &lt; b+d) || (l-d &lt; x2 &amp;&amp; x2 &lt; r+d &amp;&amp; t-d &lt; y2 &amp;&amp; y2 &lt; b+d))) {</div>
<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>&#160;                <span class="keywordflow">if</span>(inst.snapElements[i].snapping) (inst.options.snap.release &amp;&amp; inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));</div>
<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>&#160;                inst.snapElements[i].snapping = <span class="keyword">false</span>;</div>
<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>&#160;            }</div>
<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>&#160;</div>
<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>&#160;            <span class="keywordflow">if</span>(o.snapMode != <span class="stringliteral">&#39;inner&#39;</span>) {</div>
<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>&#160;                var ts = Math.abs(t - y2) &lt;= d;</div>
<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>&#160;                var bs = Math.abs(b - y1) &lt;= d;</div>
<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>&#160;                var ls = Math.abs(l - x2) &lt;= d;</div>
<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>&#160;                var rs = Math.abs(r - x1) &lt;= d;</div>
<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>&#160;                <span class="keywordflow">if</span>(ts) ui.position.top = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;</div>
<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>&#160;                <span class="keywordflow">if</span>(bs) ui.position.top = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: b, left: 0 }).top - inst.margins.top;</div>
<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>&#160;                <span class="keywordflow">if</span>(ls) ui.position.left = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;</div>
<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>&#160;                <span class="keywordflow">if</span>(rs) ui.position.left = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: 0, left: r }).left - inst.margins.left;</div>
<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>&#160;            }</div>
<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>&#160;</div>
<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>&#160;            var first = (ts || bs || ls || rs);</div>
<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>&#160;</div>
<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>&#160;            <span class="keywordflow">if</span>(o.snapMode != <span class="stringliteral">&#39;outer&#39;</span>) {</div>
<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>&#160;                var ts = Math.abs(t - y1) &lt;= d;</div>
<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>&#160;                var bs = Math.abs(b - y2) &lt;= d;</div>
<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>&#160;                var ls = Math.abs(l - x1) &lt;= d;</div>
<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>&#160;                var rs = Math.abs(r - x2) &lt;= d;</div>
<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>&#160;                <span class="keywordflow">if</span>(ts) ui.position.top = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: t, left: 0 }).top - inst.margins.top;</div>
<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>&#160;                <span class="keywordflow">if</span>(bs) ui.position.top = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;</div>
<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>&#160;                <span class="keywordflow">if</span>(ls) ui.position.left = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: 0, left: l }).left - inst.margins.left;</div>
<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>&#160;                <span class="keywordflow">if</span>(rs) ui.position.left = inst._convertPositionTo(<span class="stringliteral">&quot;relative&quot;</span>, { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;</div>
<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>&#160;            }</div>
<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>&#160;</div>
<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>&#160;            <span class="keywordflow">if</span>(!inst.snapElements[i].snapping &amp;&amp; (ts || bs || ls || rs || first))</div>
<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>&#160;                (inst.options.snap.snap &amp;&amp; inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));</div>
<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>&#160;            inst.snapElements[i].snapping = (ts || bs || ls || rs || first);</div>
<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>&#160;</div>
<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>&#160;        };</div>
<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>&#160;</div>
<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>&#160;    }</div>
<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>&#160;});</div>
<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>&#160;</div>
<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;stack&quot;</span>, {</div>
<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>&#160;</div>
<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>&#160;        var o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>).options;</div>
<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>&#160;</div>
<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>&#160;        var group = $.makeArray($(o.stack)).sort(<span class="keyword">function</span>(a,b) {</div>
<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>&#160;            <span class="keywordflow">return</span> (parseInt($(a).css(<span class="stringliteral">&quot;zIndex&quot;</span>),10) || 0) - (parseInt($(b).css(<span class="stringliteral">&quot;zIndex&quot;</span>),10) || 0);</div>
<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>&#160;        });</div>
<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>&#160;        <span class="keywordflow">if</span> (!group.length) { <span class="keywordflow">return</span>; }</div>
<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>&#160;        </div>
<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>&#160;        var min = parseInt(group[0].style.zIndex) || 0;</div>
<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>&#160;        $(group).each(<span class="keyword">function</span>(i) {</div>
<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>&#160;            this.style.zIndex = min + i;</div>
<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>&#160;        });</div>
<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>&#160;</div>
<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>&#160;        <span class="keyword">this</span>[0].style.zIndex = min + group.length;</div>
<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>&#160;</div>
<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>&#160;    }</div>
<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>&#160;});</div>
<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>&#160;</div>
<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;draggable&quot;</span>, <span class="stringliteral">&quot;zIndex&quot;</span>, {</div>
<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>&#160;        var t = $(ui.helper), o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>).options;</div>
<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>&#160;        <span class="keywordflow">if</span>(t.css(<span class="stringliteral">&quot;zIndex&quot;</span>)) o._zIndex = t.css(<span class="stringliteral">&quot;zIndex&quot;</span>);</div>
<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>&#160;        t.css(<span class="stringliteral">&#39;zIndex&#39;</span>, o.zIndex);</div>
<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>&#160;    },</div>
<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>&#160;    stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>&#160;        var o = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;draggable&quot;</span>).options;</div>
<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>&#160;        <span class="keywordflow">if</span>(o._zIndex) $(ui.helper).css(<span class="stringliteral">&#39;zIndex&#39;</span>, o._zIndex);</div>
<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>&#160;    }</div>
<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>&#160;});</div>
<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>&#160;</div>
<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>&#160;})(jQuery);</div>
<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>&#160;</div>
<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>&#160;</div>
<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>&#160;$.widget(<span class="stringliteral">&quot;ui.droppable&quot;</span>, {</div>
<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>&#160;    widgetEventPrefix: <span class="stringliteral">&quot;drop&quot;</span>,</div>
<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>&#160;    options: {</div>
<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>&#160;        accept: <span class="charliteral">&#39;*&#39;</span>,</div>
<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>&#160;        activeClass: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>&#160;        addClasses: <span class="keyword">true</span>,</div>
<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>&#160;        greedy: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>&#160;        hoverClass: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>&#160;        scope: <span class="stringliteral">&#39;default&#39;</span>,</div>
<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>&#160;        tolerance: <span class="stringliteral">&#39;intersect&#39;</span></div>
<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>&#160;    },</div>
<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>&#160;</div>
<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>&#160;        var o = this.options, accept = o.accept;</div>
<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>&#160;        this.isover = 0; this.isout = 1;</div>
<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>&#160;</div>
<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>&#160;        this.accept = $.isFunction(accept) ? accept : <span class="keyword">function</span>(d) {</div>
<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>&#160;            <span class="keywordflow">return</span> d.is(accept);</div>
<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>&#160;        };</div>
<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>&#160;</div>
<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>&#160;        <span class="comment">//Store the droppable&#39;s proportions</span></div>
<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>&#160;        this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };</div>
<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>&#160;</div>
<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160;        <span class="comment">// Add the reference and positions to the manager</span></div>
<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160;        $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];</div>
<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>&#160;        $.ui.ddmanager.droppables[o.scope].push(<span class="keyword">this</span>);</div>
<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>&#160;</div>
<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>&#160;        (o.addClasses &amp;&amp; this.element.addClass(<span class="stringliteral">&quot;ui-droppable&quot;</span>));</div>
<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>&#160;</div>
<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>&#160;    },</div>
<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>&#160;</div>
<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>&#160;        var drop = $.ui.ddmanager.droppables[this.options.scope];</div>
<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>&#160;        <span class="keywordflow">for</span> ( var i = 0; i &lt; drop.length; i++ )</div>
<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>&#160;            <span class="keywordflow">if</span> ( drop[i] == <span class="keyword">this</span> )</div>
<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>&#160;                drop.splice(i, 1);</div>
<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>&#160;</div>
<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>&#160;        this.element</div>
<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>&#160;            .removeClass(<span class="stringliteral">&quot;ui-droppable ui-droppable-disabled&quot;</span>)</div>
<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>&#160;            .removeData(<span class="stringliteral">&quot;droppable&quot;</span>)</div>
<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>&#160;            .unbind(<span class="stringliteral">&quot;.droppable&quot;</span>);</div>
<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>&#160;</div>
<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>&#160;    },</div>
<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>&#160;</div>
<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>&#160;    _setOption: <span class="keyword">function</span>(key, value) {</div>
<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>&#160;</div>
<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>&#160;        <span class="keywordflow">if</span>(key == <span class="stringliteral">&#39;accept&#39;</span>) {</div>
<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>&#160;            this.accept = $.isFunction(value) ? value : <span class="keyword">function</span>(d) {</div>
<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>&#160;                <span class="keywordflow">return</span> d.is(value);</div>
<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>&#160;            };</div>
<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>&#160;        }</div>
<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>&#160;        $.Widget.prototype._setOption.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>&#160;    },</div>
<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>&#160;</div>
<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>&#160;    _activate: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>&#160;        var draggable = $.ui.ddmanager.current;</div>
<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>&#160;        <span class="keywordflow">if</span>(this.options.activeClass) this.element.addClass(this.options.activeClass);</div>
<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>&#160;        (draggable &amp;&amp; this._trigger(<span class="stringliteral">&#39;activate&#39;</span>, event, this.ui(draggable)));</div>
<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>&#160;    },</div>
<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>&#160;</div>
<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>&#160;    _deactivate: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>&#160;        var draggable = $.ui.ddmanager.current;</div>
<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>&#160;        <span class="keywordflow">if</span>(this.options.activeClass) this.element.removeClass(this.options.activeClass);</div>
<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>&#160;        (draggable &amp;&amp; this._trigger(<span class="stringliteral">&#39;deactivate&#39;</span>, event, this.ui(draggable)));</div>
<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>&#160;    },</div>
<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>&#160;</div>
<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>&#160;    _over: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>&#160;</div>
<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>&#160;        var draggable = $.ui.ddmanager.current;</div>
<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>&#160;        <span class="keywordflow">if</span> (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) <span class="keywordflow">return</span>; <span class="comment">// Bail if draggable and droppable are same element</span></div>
<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>&#160;</div>
<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>&#160;        <span class="keywordflow">if</span> (this.accept.call(<span class="keyword">this</span>.element[0],(draggable.currentItem || draggable.element))) {</div>
<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>&#160;            <span class="keywordflow">if</span>(this.options.hoverClass) this.element.addClass(this.options.hoverClass);</div>
<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>&#160;            this._trigger(<span class="stringliteral">&#39;over&#39;</span>, event, this.ui(draggable));</div>
<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>&#160;        }</div>
<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>&#160;</div>
<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>&#160;    },</div>
<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>&#160;</div>
<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>&#160;    _out: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>&#160;</div>
<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>&#160;        var draggable = $.ui.ddmanager.current;</div>
<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>&#160;        <span class="keywordflow">if</span> (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) <span class="keywordflow">return</span>; <span class="comment">// Bail if draggable and droppable are same element</span></div>
<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>&#160;</div>
<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>&#160;        <span class="keywordflow">if</span> (this.accept.call(<span class="keyword">this</span>.element[0],(draggable.currentItem || draggable.element))) {</div>
<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>&#160;            <span class="keywordflow">if</span>(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);</div>
<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>&#160;            this._trigger(<span class="stringliteral">&#39;out&#39;</span>, event, this.ui(draggable));</div>
<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>&#160;        }</div>
<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>&#160;</div>
<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>&#160;    },</div>
<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>&#160;</div>
<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>&#160;    _drop: <span class="keyword">function</span>(event,custom) {</div>
<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>&#160;</div>
<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>&#160;        var draggable = custom || $.ui.ddmanager.current;</div>
<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>&#160;        <span class="keywordflow">if</span> (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Bail if draggable and droppable are same element</span></div>
<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>&#160;</div>
<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>&#160;        var childrenIntersection = <span class="keyword">false</span>;</div>
<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>&#160;        this.element.find(<span class="stringliteral">&quot;:data(droppable)&quot;</span>).not(<span class="stringliteral">&quot;.ui-draggable-dragging&quot;</span>).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>&#160;            var inst = $.data(<span class="keyword">this</span>, <span class="stringliteral">&#39;droppable&#39;</span>);</div>
<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>&#160;            <span class="keywordflow">if</span>(</div>
<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>&#160;                inst.options.greedy</div>
<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>&#160;                &amp;&amp; !inst.options.disabled</div>
<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>&#160;                &amp;&amp; inst.options.scope == draggable.options.scope</div>
<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>&#160;                &amp;&amp; inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))</div>
<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>&#160;                &amp;&amp; $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)</div>
<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>&#160;            ) { childrenIntersection = <span class="keyword">true</span>; <span class="keywordflow">return</span> <span class="keyword">false</span>; }</div>
<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>&#160;        });</div>
<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>&#160;        <span class="keywordflow">if</span>(childrenIntersection) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>&#160;</div>
<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>&#160;        <span class="keywordflow">if</span>(this.accept.call(<span class="keyword">this</span>.element[0],(draggable.currentItem || draggable.element))) {</div>
<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>&#160;            <span class="keywordflow">if</span>(this.options.activeClass) this.element.removeClass(this.options.activeClass);</div>
<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>&#160;            <span class="keywordflow">if</span>(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);</div>
<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>&#160;            this._trigger(<span class="stringliteral">&#39;drop&#39;</span>, event, this.ui(draggable));</div>
<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>&#160;            <span class="keywordflow">return</span> this.element;</div>
<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>&#160;        }</div>
<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>&#160;</div>
<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>&#160;</div>
<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>&#160;    },</div>
<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>&#160;</div>
<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>&#160;    ui: <span class="keyword">function</span>(c) {</div>
<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>&#160;            draggable: (c.currentItem || c.element),</div>
<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>&#160;            helper: c.helper,</div>
<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>&#160;            position: c.position,</div>
<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>&#160;            offset: c.positionAbs</div>
<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>&#160;        };</div>
<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>&#160;    }</div>
<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>&#160;</div>
<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>&#160;});</div>
<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>&#160;</div>
<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>&#160;$.extend($.ui.droppable, {</div>
<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>&#160;});</div>
<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>&#160;</div>
<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>&#160;$.ui.intersect = <span class="keyword">function</span>(draggable, droppable, toleranceMode) {</div>
<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>&#160;</div>
<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>&#160;    <span class="keywordflow">if</span> (!droppable.offset) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>&#160;</div>
<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>&#160;    var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,</div>
<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>&#160;        y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;</div>
<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>&#160;    var l = droppable.offset.left, r = l + droppable.proportions.width,</div>
<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>&#160;        t = droppable.offset.top, b = t + droppable.proportions.height;</div>
<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>&#160;</div>
<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>&#160;    <span class="keywordflow">switch</span> (toleranceMode) {</div>
<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>&#160;        <span class="keywordflow">case</span> <span class="stringliteral">&#39;fit&#39;</span>:</div>
<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>&#160;            <span class="keywordflow">return</span> (l &lt;= x1 &amp;&amp; x2 &lt;= r</div>
<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>&#160;                &amp;&amp; t &lt;= y1 &amp;&amp; y2 &lt;= b);</div>
<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>&#160;        <span class="keywordflow">case</span> <span class="stringliteral">&#39;intersect&#39;</span>:</div>
<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>&#160;            <span class="keywordflow">return</span> (l &lt; x1 + (draggable.helperProportions.width / 2) <span class="comment">// Right Half</span></div>
<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>&#160;                &amp;&amp; x2 - (draggable.helperProportions.width / 2) &lt; r <span class="comment">// Left Half</span></div>
<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>&#160;                &amp;&amp; t &lt; y1 + (draggable.helperProportions.height / 2) <span class="comment">// Bottom Half</span></div>
<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>&#160;                &amp;&amp; y2 - (draggable.helperProportions.height / 2) &lt; b ); <span class="comment">// Top Half</span></div>
<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>&#160;        <span class="keywordflow">case</span> <span class="stringliteral">&#39;pointer&#39;</span>:</div>
<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>&#160;            var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),</div>
<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>&#160;                draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),</div>
<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>&#160;                isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);</div>
<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>&#160;            <span class="keywordflow">return</span> isOver;</div>
<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>&#160;        <span class="keywordflow">case</span> <span class="stringliteral">&#39;touch&#39;</span>:</div>
<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>&#160;            <span class="keywordflow">return</span> (</div>
<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>&#160;                    (y1 &gt;= t &amp;&amp; y1 &lt;= b) || <span class="comment">// Top edge touching</span></div>
<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>&#160;                    (y2 &gt;= t &amp;&amp; y2 &lt;= b) || <span class="comment">// Bottom edge touching</span></div>
<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>&#160;                    (y1 &lt; t &amp;&amp; y2 &gt; b)      <span class="comment">// Surrounded vertically</span></div>
<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>&#160;                ) &amp;&amp; (</div>
<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>&#160;                    (x1 &gt;= l &amp;&amp; x1 &lt;= r) || <span class="comment">// Left edge touching</span></div>
<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>&#160;                    (x2 &gt;= l &amp;&amp; x2 &lt;= r) || <span class="comment">// Right edge touching</span></div>
<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>&#160;                    (x1 &lt; l &amp;&amp; x2 &gt; r)      <span class="comment">// Surrounded horizontally</span></div>
<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>&#160;                );</div>
<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>&#160;        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>&#160;        }</div>
<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>&#160;</div>
<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>&#160;};</div>
<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>&#160;</div>
<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>&#160;<span class="comment">    This manager tracks offsets of draggables and droppables</span></div>
<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>&#160;$.ui.ddmanager = {</div>
<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>&#160;    current: null,</div>
<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>&#160;    droppables: { <span class="stringliteral">&#39;default&#39;</span>: [] },</div>
<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>&#160;    prepareOffsets: <span class="keyword">function</span>(t, event) {</div>
<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>&#160;</div>
<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>&#160;        var m = $.ui.ddmanager.droppables[t.options.scope] || [];</div>
<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>&#160;        var type = <span class="keyword">event</span> ? <span class="keyword">event</span>.type : null; <span class="comment">// workaround for #2317</span></div>
<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>&#160;        var list = (t.currentItem || t.element).find(<span class="stringliteral">&quot;:data(droppable)&quot;</span>).andSelf();</div>
<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>&#160;</div>
<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>&#160;        droppablesLoop: <span class="keywordflow">for</span> (var i = 0; i &lt; m.length; i++) {</div>
<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>&#160;</div>
<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>&#160;            <span class="keywordflow">if</span>(m[i].options.disabled || (t &amp;&amp; !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) <span class="keywordflow">continue</span>;   <span class="comment">//No disabled and non-accepted</span></div>
<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>&#160;            <span class="keywordflow">for</span> (var j=0; j &lt; list.length; j++) { <span class="keywordflow">if</span>(list[j] == m[i].element[0]) { m[i].proportions.height = 0; <span class="keywordflow">continue</span> droppablesLoop; } }; <span class="comment">//Filter out elements in the current dragged item</span></div>
<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>&#160;            m[i].visible = m[i].element.css(<span class="stringliteral">&quot;display&quot;</span>) != <span class="stringliteral">&quot;none&quot;</span>; <span class="keywordflow">if</span>(!m[i].visible) <span class="keywordflow">continue</span>;                                   <span class="comment">//If the element is not visible, continue</span></div>
<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>&#160;</div>
<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>&#160;            <span class="keywordflow">if</span>(type == <span class="stringliteral">&quot;mousedown&quot;</span>) m[i]._activate.call(m[i], event); <span class="comment">//Activate the droppable if used directly from draggables</span></div>
<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>&#160;</div>
<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>&#160;            m[i].offset = m[i].element.offset();</div>
<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>&#160;            m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };</div>
<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>&#160;</div>
<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>&#160;        }</div>
<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>&#160;</div>
<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>&#160;    },</div>
<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>&#160;    drop: <span class="keyword">function</span>(draggable, event) {</div>
<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>&#160;</div>
<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>&#160;        var dropped = <span class="keyword">false</span>;</div>
<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>&#160;        $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>&#160;</div>
<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>&#160;            <span class="keywordflow">if</span>(!<span class="keyword">this</span>.options) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>&#160;            if (!this.options.disabled &amp;&amp; <span class="keyword">this</span>.visible &amp;&amp; $.ui.intersect(draggable, <span class="keyword">this</span>, <span class="keyword">this</span>.options.tolerance))</div>
<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>&#160;                dropped = this._drop.call(<span class="keyword">this</span>, event) || dropped;</div>
<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>&#160;</div>
<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>&#160;            <span class="keywordflow">if</span> (!this.options.disabled &amp;&amp; <span class="keyword">this</span>.visible &amp;&amp; <span class="keyword">this</span>.accept.call(<span class="keyword">this</span>.element[0],(draggable.currentItem || draggable.element))) {</div>
<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>&#160;                this.isout = 1; this.isover = 0;</div>
<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>&#160;                this._deactivate.call(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>&#160;            }</div>
<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>&#160;</div>
<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>&#160;        });</div>
<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>&#160;        <span class="keywordflow">return</span> dropped;</div>
<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>&#160;</div>
<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>&#160;    },</div>
<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>&#160;    dragStart: <span class="keyword">function</span>( draggable, event ) {</div>
<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>&#160;        <span class="comment">//Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)</span></div>
<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>&#160;        draggable.element.parents( <span class="stringliteral">&quot;:not(body,html)&quot;</span> ).bind( <span class="stringliteral">&quot;scroll.droppable&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>&#160;            <span class="keywordflow">if</span>( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );</div>
<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>&#160;        });</div>
<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>&#160;    },</div>
<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>&#160;    drag: <span class="keyword">function</span>(draggable, event) {</div>
<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>&#160;</div>
<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>&#160;        <span class="comment">//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.</span></div>
<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>&#160;        <span class="keywordflow">if</span>(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);</div>
<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>&#160;</div>
<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>&#160;        <span class="comment">//Run through all droppables and check their positions based on specific tolerance options</span></div>
<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>&#160;        $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>&#160;</div>
<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>&#160;            <span class="keywordflow">if</span>(<span class="keyword">this</span>.options.disabled || <span class="keyword">this</span>.greedyChild || !<span class="keyword">this</span>.visible) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>&#160;            var intersects = $.ui.intersect(draggable, <span class="keyword">this</span>, <span class="keyword">this</span>.options.tolerance);</div>
<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>&#160;</div>
<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>&#160;            var c = !intersects &amp;&amp; this.isover == 1 ? <span class="stringliteral">&#39;isout&#39;</span> : (intersects &amp;&amp; this.isover == 0 ? <span class="stringliteral">&#39;isover&#39;</span> : null);</div>
<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>&#160;            <span class="keywordflow">if</span>(!c) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>&#160;</div>
<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>&#160;            var parentInstance;</div>
<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>&#160;            <span class="keywordflow">if</span> (this.options.greedy) {</div>
<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>&#160;                var parent = this.element.parents(<span class="stringliteral">&#39;:data(droppable):eq(0)&#39;</span>);</div>
<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>&#160;                <span class="keywordflow">if</span> (parent.length) {</div>
<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>&#160;                    parentInstance = $.data(parent[0], <span class="stringliteral">&#39;droppable&#39;</span>);</div>
<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>&#160;                    parentInstance.greedyChild = (c == <span class="stringliteral">&#39;isover&#39;</span> ? 1 : 0);</div>
<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>&#160;                }</div>
<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>&#160;            }</div>
<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>&#160;</div>
<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>&#160;            <span class="comment">// we just moved into a greedy child</span></div>
<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>&#160;            <span class="keywordflow">if</span> (parentInstance &amp;&amp; c == <span class="stringliteral">&#39;isover&#39;</span>) {</div>
<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>&#160;                parentInstance[<span class="stringliteral">&#39;isover&#39;</span>] = 0;</div>
<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>&#160;                parentInstance[<span class="stringliteral">&#39;isout&#39;</span>] = 1;</div>
<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>&#160;                parentInstance._out.call(parentInstance, event);</div>
<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>&#160;            }</div>
<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>&#160;</div>
<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>&#160;            <span class="keyword">this</span>[c] = 1; <span class="keyword">this</span>[c == <span class="stringliteral">&#39;isout&#39;</span> ? <span class="stringliteral">&#39;isover&#39;</span> : <span class="stringliteral">&#39;isout&#39;</span>] = 0;</div>
<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>&#160;            <span class="keyword">this</span>[c == <span class="stringliteral">&quot;isover&quot;</span> ? <span class="stringliteral">&quot;_over&quot;</span> : <span class="stringliteral">&quot;_out&quot;</span>].call(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>&#160;</div>
<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>&#160;            <span class="comment">// we just moved out of a greedy child</span></div>
<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>&#160;            <span class="keywordflow">if</span> (parentInstance &amp;&amp; c == <span class="stringliteral">&#39;isout&#39;</span>) {</div>
<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>&#160;                parentInstance[<span class="stringliteral">&#39;isout&#39;</span>] = 0;</div>
<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>&#160;                parentInstance[<span class="stringliteral">&#39;isover&#39;</span>] = 1;</div>
<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>&#160;                parentInstance._over.call(parentInstance, event);</div>
<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>&#160;            }</div>
<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>&#160;        });</div>
<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>&#160;</div>
<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>&#160;    },</div>
<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>&#160;    dragStop: <span class="keyword">function</span>( draggable, event ) {</div>
<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>&#160;        draggable.element.parents( <span class="stringliteral">&quot;:not(body,html)&quot;</span> ).unbind( <span class="stringliteral">&quot;scroll.droppable&quot;</span> );</div>
<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>&#160;        <span class="comment">//Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)</span></div>
<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>&#160;        <span class="keywordflow">if</span>( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );</div>
<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>&#160;    }</div>
<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>&#160;};</div>
<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>&#160;</div>
<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>&#160;})(jQuery);</div>
<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>&#160;</div>
<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>&#160;</div>
<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>&#160;$.widget(<span class="stringliteral">&quot;ui.resizable&quot;</span>, $.ui.mouse, {</div>
<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>&#160;    widgetEventPrefix: <span class="stringliteral">&quot;resize&quot;</span>,</div>
<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>&#160;    options: {</div>
<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>&#160;        alsoResize: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>&#160;        animate: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>&#160;        animateDuration: <span class="stringliteral">&quot;slow&quot;</span>,</div>
<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>&#160;        animateEasing: <span class="stringliteral">&quot;swing&quot;</span>,</div>
<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>&#160;        aspectRatio: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>&#160;        autoHide: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>&#160;        containment: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>&#160;        ghost: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>&#160;        grid: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>&#160;        handles: <span class="stringliteral">&quot;e,s,se&quot;</span>,</div>
<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>&#160;        helper: <span class="keyword">false</span>,</div>
<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>&#160;        maxHeight: null,</div>
<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>&#160;        maxWidth: null,</div>
<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>&#160;        minHeight: 10,</div>
<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>&#160;        minWidth: 10,</div>
<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>&#160;        zIndex: 1000</div>
<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>&#160;    },</div>
<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>&#160;</div>
<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>, o = this.options;</div>
<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>&#160;        this.element.addClass(<span class="stringliteral">&quot;ui-resizable&quot;</span>);</div>
<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>&#160;</div>
<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>&#160;        $.extend(<span class="keyword">this</span>, {</div>
<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>&#160;            _aspectRatio: !!(o.aspectRatio),</div>
<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>&#160;            aspectRatio: o.aspectRatio,</div>
<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>&#160;            originalElement: <span class="keyword">this</span>.element,</div>
<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>&#160;            _proportionallyResizeElements: [],</div>
<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>&#160;            _helper: o.helper || o.ghost || o.animate ? o.helper || <span class="stringliteral">&#39;ui-resizable-helper&#39;</span> : null</div>
<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>&#160;        });</div>
<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>&#160;</div>
<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>&#160;        <span class="comment">//Wrap the element if it cannot hold child nodes</span></div>
<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>&#160;        <span class="keywordflow">if</span>(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {</div>
<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>&#160;</div>
<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>&#160;            <span class="comment">//Create a wrapper element and set the wrapper to the new current internal element</span></div>
<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>&#160;            this.element.wrap(</div>
<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>&#160;                $(<span class="stringliteral">&#39;&lt;div class=&quot;ui-wrapper&quot; style=&quot;overflow: hidden;&quot;&gt;&lt;/div&gt;&#39;</span>).css({</div>
<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>&#160;                    position: this.element.css(<span class="stringliteral">&#39;position&#39;</span>),</div>
<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>&#160;                    width: this.element.outerWidth(),</div>
<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>&#160;                    height: this.element.outerHeight(),</div>
<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>&#160;                    top: this.element.css(<span class="stringliteral">&#39;top&#39;</span>),</div>
<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>&#160;                    left: this.element.css(<span class="stringliteral">&#39;left&#39;</span>)</div>
<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>&#160;                })</div>
<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>&#160;            );</div>
<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>&#160;</div>
<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>&#160;            <span class="comment">//Overwrite the original this.element</span></div>
<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>&#160;            this.element = this.element.parent().data(</div>
<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>&#160;                <span class="stringliteral">&quot;resizable&quot;</span>, this.element.data(<span class="stringliteral">&#39;resizable&#39;</span>)</div>
<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>&#160;            );</div>
<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>&#160;</div>
<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>&#160;            this.elementIsWrapper = <span class="keyword">true</span>;</div>
<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>&#160;</div>
<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>&#160;            <span class="comment">//Move margins to the wrapper</span></div>
<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>&#160;            this.element.css({ marginLeft: this.originalElement.css(<span class="stringliteral">&quot;marginLeft&quot;</span>), marginTop: this.originalElement.css(<span class="stringliteral">&quot;marginTop&quot;</span>), marginRight: this.originalElement.css(<span class="stringliteral">&quot;marginRight&quot;</span>), marginBottom: this.originalElement.css(<span class="stringliteral">&quot;marginBottom&quot;</span>) });</div>
<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>&#160;            this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});</div>
<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>&#160;</div>
<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>&#160;            <span class="comment">//Prevent Safari textarea resize</span></div>
<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>&#160;            this.originalResizeStyle = this.originalElement.css(<span class="stringliteral">&#39;resize&#39;</span>);</div>
<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>&#160;            this.originalElement.css(<span class="stringliteral">&#39;resize&#39;</span>, <span class="stringliteral">&#39;none&#39;</span>);</div>
<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>&#160;</div>
<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>&#160;            <span class="comment">//Push the actual element to our proportionallyResize internal array</span></div>
<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>&#160;            this._proportionallyResizeElements.push(this.originalElement.css({ position: <span class="stringliteral">&#39;static&#39;</span>, zoom: 1, display: <span class="stringliteral">&#39;block&#39;</span> }));</div>
<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>&#160;</div>
<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>&#160;            <span class="comment">// avoid IE jump (hard set the margin)</span></div>
<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>&#160;            this.originalElement.css({ margin: this.originalElement.css(<span class="stringliteral">&#39;margin&#39;</span>) });</div>
<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>&#160;</div>
<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>&#160;            <span class="comment">// fix handlers offset</span></div>
<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>&#160;            this._proportionallyResize();</div>
<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>&#160;</div>
<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>&#160;        }</div>
<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>&#160;</div>
<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>&#160;        this.handles = o.handles || (!$(<span class="stringliteral">&#39;.ui-resizable-handle&#39;</span>, this.element).length ? <span class="stringliteral">&quot;e,s,se&quot;</span> : { n: <span class="stringliteral">&#39;.ui-resizable-n&#39;</span>, e: <span class="stringliteral">&#39;.ui-resizable-e&#39;</span>, s: <span class="stringliteral">&#39;.ui-resizable-s&#39;</span>, w: <span class="stringliteral">&#39;.ui-resizable-w&#39;</span>, se: <span class="stringliteral">&#39;.ui-resizable-se&#39;</span>, sw: <span class="stringliteral">&#39;.ui-resizable-sw&#39;</span>, ne: <span class="stringliteral">&#39;.ui-resizable-ne&#39;</span>, nw: <span class="stringliteral">&#39;.ui-resizable-nw&#39;</span> });</div>
<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>&#160;        <span class="keywordflow">if</span>(this.handles.constructor == String) {</div>
<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>&#160;</div>
<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>&#160;            <span class="keywordflow">if</span>(this.handles == <span class="stringliteral">&#39;all&#39;</span>) this.handles = <span class="stringliteral">&#39;n,e,s,w,se,sw,ne,nw&#39;</span>;</div>
<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>&#160;            var n = this.handles.split(<span class="stringliteral">&quot;,&quot;</span>); this.handles = {};</div>
<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>&#160;</div>
<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>&#160;            <span class="keywordflow">for</span>(var i = 0; i &lt; n.length; i++) {</div>
<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>&#160;</div>
<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>&#160;                var handle = $.trim(n[i]), hname = <span class="stringliteral">&#39;ui-resizable-&#39;</span>+handle;</div>
<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>&#160;                var axis = $(<span class="stringliteral">&#39;&lt;div class=&quot;ui-resizable-handle &#39;</span> + hname + <span class="stringliteral">&#39;&quot;&gt;&lt;/div&gt;&#39;</span>);</div>
<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>&#160;</div>
<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>&#160;                <span class="comment">// Apply zIndex to all handles - see #7960</span></div>
<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>&#160;                axis.css({ zIndex: o.zIndex });</div>
<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>&#160;</div>
<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>&#160;                <span class="comment">//TODO : What&#39;s going on here?</span></div>
<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>&#160;                <span class="keywordflow">if</span> (<span class="stringliteral">&#39;se&#39;</span> == handle) {</div>
<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>&#160;                    axis.addClass(<span class="stringliteral">&#39;ui-icon ui-icon-gripsmall-diagonal-se&#39;</span>);</div>
<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>&#160;                };</div>
<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>&#160;</div>
<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>&#160;                <span class="comment">//Insert into internal handles object and append to element</span></div>
<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>&#160;                this.handles[handle] = <span class="stringliteral">&#39;.ui-resizable-&#39;</span>+handle;</div>
<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>&#160;                this.element.append(axis);</div>
<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>&#160;            }</div>
<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>&#160;</div>
<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>&#160;        }</div>
<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>&#160;</div>
<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>&#160;        this._renderAxis = <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>&#160;</div>
<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>&#160;            target = target || this.element;</div>
<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>&#160;</div>
<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>&#160;            <span class="keywordflow">for</span>(var i in this.handles) {</div>
<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>&#160;</div>
<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>&#160;                <span class="keywordflow">if</span>(this.handles[i].constructor == String)</div>
<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>&#160;                    this.handles[i] = $(this.handles[i], this.element).show();</div>
<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>&#160;</div>
<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>&#160;                <span class="comment">//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)</span></div>
<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>&#160;                <span class="keywordflow">if</span> (this.elementIsWrapper &amp;&amp; this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {</div>
<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>&#160;</div>
<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>&#160;                    var axis = $(this.handles[i], this.element), padWrapper = 0;</div>
<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>&#160;</div>
<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>&#160;                    <span class="comment">//Checking the correct pad and border</span></div>
<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>&#160;                    padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();</div>
<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>&#160;</div>
<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>&#160;                    <span class="comment">//The padding type i have to apply...</span></div>
<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>&#160;                    var padPos = [ <span class="stringliteral">&#39;padding&#39;</span>,</div>
<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>&#160;                        /ne|nw|n/.test(i) ? <span class="stringliteral">&#39;Top&#39;</span> :</div>
<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>&#160;                        /se|sw|s/.test(i) ? <span class="stringliteral">&#39;Bottom&#39;</span> :</div>
<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>&#160;                        /^e$/.test(i) ? <span class="stringliteral">&#39;Right&#39;</span> : <span class="stringliteral">&#39;Left&#39;</span> ].join(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>&#160;</div>
<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>&#160;                    target.css(padPos, padWrapper);</div>
<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>&#160;</div>
<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>&#160;                    this._proportionallyResize();</div>
<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>&#160;</div>
<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>&#160;                }</div>
<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>&#160;</div>
<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>&#160;                <span class="comment">//TODO: What&#39;s that good for? There&#39;s not anything to be executed left</span></div>
<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>&#160;                <span class="keywordflow">if</span>(!$(this.handles[i]).length)</div>
<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>&#160;                    <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>&#160;</div>
<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>&#160;            }</div>
<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>&#160;        };</div>
<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>&#160;</div>
<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>&#160;        <span class="comment">//TODO: make renderAxis a prototype function</span></div>
<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>&#160;        this._renderAxis(this.element);</div>
<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>&#160;</div>
<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>&#160;        this._handles = $(<span class="stringliteral">&#39;.ui-resizable-handle&#39;</span>, this.element)</div>
<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>&#160;            .disableSelection();</div>
<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>&#160;</div>
<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>&#160;        <span class="comment">//Matching axis name</span></div>
<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>&#160;        this._handles.mouseover(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>&#160;            <span class="keywordflow">if</span> (!<span class="keyword">self</span>.resizing) {</div>
<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>&#160;                <span class="keywordflow">if</span> (this.className)</div>
<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>&#160;                    var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);</div>
<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>&#160;                <span class="comment">//Axis, default = se</span></div>
<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>&#160;                <span class="keyword">self</span>.axis = axis &amp;&amp; axis[1] ? axis[1] : <span class="stringliteral">&#39;se&#39;</span>;</div>
<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>&#160;            }</div>
<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>&#160;        });</div>
<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>&#160;</div>
<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>&#160;        <span class="comment">//If we want to auto hide the elements</span></div>
<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>&#160;        <span class="keywordflow">if</span> (o.autoHide) {</div>
<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>&#160;            this._handles.hide();</div>
<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>&#160;            $(this.element)</div>
<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>&#160;                .addClass(<span class="stringliteral">&quot;ui-resizable-autohide&quot;</span>)</div>
<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>&#160;                .hover(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>&#160;                    <span class="keywordflow">if</span> (o.disabled) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>&#160;                    $(<span class="keyword">this</span>).removeClass(<span class="stringliteral">&quot;ui-resizable-autohide&quot;</span>);</div>
<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>&#160;                    <span class="keyword">self</span>._handles.show();</div>
<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>&#160;                },</div>
<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>&#160;                <span class="keyword">function</span>(){</div>
<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>&#160;                    <span class="keywordflow">if</span> (o.disabled) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>&#160;                    <span class="keywordflow">if</span> (!<span class="keyword">self</span>.resizing) {</div>
<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>&#160;                        $(<span class="keyword">this</span>).addClass(<span class="stringliteral">&quot;ui-resizable-autohide&quot;</span>);</div>
<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>&#160;                        <span class="keyword">self</span>._handles.hide();</div>
<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>&#160;                    }</div>
<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>&#160;                });</div>
<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>&#160;        }</div>
<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>&#160;</div>
<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>&#160;        <span class="comment">//Initialize the mouse interaction</span></div>
<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>&#160;        this._mouseInit();</div>
<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>&#160;</div>
<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>&#160;    },</div>
<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>&#160;</div>
<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>&#160;</div>
<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>&#160;        this._mouseDestroy();</div>
<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>&#160;</div>
<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>&#160;        var _destroy = <span class="keyword">function</span>(exp) {</div>
<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>&#160;            $(exp).removeClass(<span class="stringliteral">&quot;ui-resizable ui-resizable-disabled ui-resizable-resizing&quot;</span>)</div>
<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>&#160;                .removeData(<span class="stringliteral">&quot;resizable&quot;</span>).unbind(<span class="stringliteral">&quot;.resizable&quot;</span>).find(<span class="stringliteral">&#39;.ui-resizable-handle&#39;</span>).remove();</div>
<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>&#160;        };</div>
<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>&#160;</div>
<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>&#160;        <span class="comment">//TODO: Unwrap at same DOM position</span></div>
<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>&#160;        <span class="keywordflow">if</span> (this.elementIsWrapper) {</div>
<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>&#160;            _destroy(this.element);</div>
<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>&#160;            var wrapper = this.element;</div>
<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>&#160;            wrapper.after(</div>
<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>&#160;                this.originalElement.css({</div>
<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>&#160;                    position: wrapper.css(<span class="stringliteral">&#39;position&#39;</span>),</div>
<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>&#160;                    width: wrapper.outerWidth(),</div>
<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>&#160;                    height: wrapper.outerHeight(),</div>
<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>&#160;                    top: wrapper.css(<span class="stringliteral">&#39;top&#39;</span>),</div>
<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>&#160;                    left: wrapper.css(<span class="stringliteral">&#39;left&#39;</span>)</div>
<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>&#160;                })</div>
<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>&#160;            ).remove();</div>
<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>&#160;        }</div>
<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>&#160;</div>
<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>&#160;        this.originalElement.css(<span class="stringliteral">&#39;resize&#39;</span>, this.originalResizeStyle);</div>
<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>&#160;        _destroy(this.originalElement);</div>
<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>&#160;</div>
<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>&#160;    },</div>
<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>&#160;</div>
<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>&#160;    _mouseCapture: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>&#160;        var handle = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>&#160;        <span class="keywordflow">for</span> (var i in this.handles) {</div>
<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>&#160;            <span class="keywordflow">if</span> ($(this.handles[i])[0] == <span class="keyword">event</span>.target) {</div>
<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>&#160;                handle = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>&#160;            }</div>
<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>&#160;        }</div>
<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>&#160;</div>
<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>&#160;        <span class="keywordflow">return</span> !this.options.disabled &amp;&amp; handle;</div>
<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>&#160;    },</div>
<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>&#160;</div>
<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>&#160;    _mouseStart: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>&#160;</div>
<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>&#160;        var o = this.options, iniPos = this.element.position(), el = this.element;</div>
<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>&#160;</div>
<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>&#160;        this.resizing = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>&#160;        this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };</div>
<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>&#160;</div>
<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>&#160;        <span class="comment">// bugfix for http://dev.jquery.com/ticket/1749</span></div>
<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>&#160;        <span class="keywordflow">if</span> (el.is(<span class="stringliteral">&#39;.ui-draggable&#39;</span>) || (/absolute/).test(el.css(<span class="stringliteral">&#39;position&#39;</span>))) {</div>
<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>&#160;            el.css({ position: <span class="stringliteral">&#39;absolute&#39;</span>, top: iniPos.top, left: iniPos.left });</div>
<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>&#160;        }</div>
<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>&#160;</div>
<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>&#160;        this._renderProxy();</div>
<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>&#160;</div>
<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>&#160;        var curleft = num(this.helper.css(<span class="stringliteral">&#39;left&#39;</span>)), curtop = num(this.helper.css(<span class="stringliteral">&#39;top&#39;</span>));</div>
<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>&#160;</div>
<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>&#160;        <span class="keywordflow">if</span> (o.containment) {</div>
<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>&#160;            curleft += $(o.containment).scrollLeft() || 0;</div>
<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>&#160;            curtop += $(o.containment).scrollTop() || 0;</div>
<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>&#160;        }</div>
<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>&#160;</div>
<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>&#160;        <span class="comment">//Store needed variables</span></div>
<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>&#160;        this.offset = this.helper.offset();</div>
<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>&#160;        this.position = { left: curleft, top: curtop };</div>
<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>&#160;        this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };</div>
<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>&#160;        this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };</div>
<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>&#160;        this.originalPosition = { left: curleft, top: curtop };</div>
<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>&#160;        this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };</div>
<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>&#160;        this.originalMousePosition = { left: <span class="keyword">event</span>.pageX, top: <span class="keyword">event</span>.pageY };</div>
<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>&#160;</div>
<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>&#160;        <span class="comment">//Aspect Ratio</span></div>
<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>&#160;        this.aspectRatio = (typeof o.aspectRatio == <span class="stringliteral">&#39;number&#39;</span>) ? o.aspectRatio : ((<span class="keyword">this</span>.originalSize.width / <span class="keyword">this</span>.originalSize.height) || 1);</div>
<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>&#160;</div>
<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>&#160;        var cursor = $(<span class="stringliteral">&#39;.ui-resizable-&#39;</span> + this.axis).css(<span class="stringliteral">&#39;cursor&#39;</span>);</div>
<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>&#160;        $(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&#39;cursor&#39;</span>, cursor == <span class="stringliteral">&#39;auto&#39;</span> ? this.axis + <span class="stringliteral">&#39;-resize&#39;</span> : cursor);</div>
<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>&#160;</div>
<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>&#160;        el.addClass(<span class="stringliteral">&quot;ui-resizable-resizing&quot;</span>);</div>
<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>&#160;        this._propagate(<span class="stringliteral">&quot;start&quot;</span>, event);</div>
<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>&#160;    },</div>
<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>&#160;</div>
<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>&#160;    _mouseDrag: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>&#160;</div>
<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>&#160;        <span class="comment">//Increase performance, avoid regex</span></div>
<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>&#160;        var el = this.helper, o = this.options, props = {},</div>
<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>&#160;            <span class="keyword">self</span> = <span class="keyword">this</span>, smp = this.originalMousePosition, a = this.axis;</div>
<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>&#160;</div>
<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>&#160;        var dx = (<span class="keyword">event</span>.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;</div>
<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>&#160;        var trigger = this._change[a];</div>
<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>&#160;        <span class="keywordflow">if</span> (!trigger) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>&#160;</div>
<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>&#160;        <span class="comment">// Calculate the attrs that will be change</span></div>
<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>&#160;        var data = trigger.apply(<span class="keyword">this</span>, [event, dx, dy]), ie6 = $.browser.msie &amp;&amp; $.browser.version &lt; 7, csdif = this.sizeDiff;</div>
<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>&#160;</div>
<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>&#160;        <span class="comment">// Put this in the mouseDrag handler since the user can start pressing shift while resizing</span></div>
<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>&#160;        this._updateVirtualBoundaries(event.shiftKey);</div>
<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>&#160;        <span class="keywordflow">if</span> (this._aspectRatio || event.shiftKey)</div>
<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>&#160;            data = this._updateRatio(data, event);</div>
<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>&#160;</div>
<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>&#160;        data = this._respectSize(data, event);</div>
<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>&#160;</div>
<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>&#160;        <span class="comment">// plugins callbacks need to be called first</span></div>
<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>&#160;        this._propagate(<span class="stringliteral">&quot;resize&quot;</span>, event);</div>
<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>&#160;</div>
<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>&#160;        el.css({</div>
<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>&#160;            top: this.position.top + <span class="stringliteral">&quot;px&quot;</span>, left: this.position.left + <span class="stringliteral">&quot;px&quot;</span>,</div>
<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>&#160;            width: this.size.width + <span class="stringliteral">&quot;px&quot;</span>, height: this.size.height + <span class="stringliteral">&quot;px&quot;</span></div>
<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>&#160;        });</div>
<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>&#160;</div>
<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>&#160;        <span class="keywordflow">if</span> (!this._helper &amp;&amp; this._proportionallyResizeElements.length)</div>
<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>&#160;            this._proportionallyResize();</div>
<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>&#160;</div>
<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>&#160;        this._updateCache(data);</div>
<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>&#160;</div>
<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>&#160;        <span class="comment">// calling the user callback at the end</span></div>
<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>&#160;        this._trigger(<span class="stringliteral">&#39;resize&#39;</span>, event, this.ui());</div>
<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>&#160;</div>
<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>&#160;    },</div>
<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>&#160;</div>
<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>&#160;    _mouseStop: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>&#160;</div>
<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>&#160;        this.resizing = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>&#160;        var o = this.options, <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>&#160;</div>
<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>&#160;        <span class="keywordflow">if</span>(this._helper) {</div>
<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>&#160;            var pr = this._proportionallyResizeElements, ista = pr.length &amp;&amp; (/textarea/i).test(pr[0].nodeName),</div>
<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>&#160;                soffseth = ista &amp;&amp; $.ui.hasScroll(pr[0], <span class="stringliteral">&#39;left&#39;</span>) <span class="comment">/* TODO - jump height */</span> ? 0 : <span class="keyword">self</span>.sizeDiff.height,</div>
<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>&#160;                soffsetw = ista ? 0 : <span class="keyword">self</span>.sizeDiff.width;</div>
<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>&#160;</div>
<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>&#160;            var s = { width: (<span class="keyword">self</span>.helper.width()  - soffsetw), height: (<span class="keyword">self</span>.helper.height() - soffseth) },</div>
<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>&#160;                left = (parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;left&#39;</span>), 10) + (<span class="keyword">self</span>.position.left - <span class="keyword">self</span>.originalPosition.left)) || null,</div>
<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>&#160;                top = (parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;top&#39;</span>), 10) + (<span class="keyword">self</span>.position.top - <span class="keyword">self</span>.originalPosition.top)) || null;</div>
<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>&#160;</div>
<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>&#160;            <span class="keywordflow">if</span> (!o.animate)</div>
<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>&#160;                this.element.css($.extend(s, { top: top, left: left }));</div>
<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>&#160;</div>
<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>&#160;            <span class="keyword">self</span>.helper.height(<span class="keyword">self</span>.size.height);</div>
<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>&#160;            <span class="keyword">self</span>.helper.width(<span class="keyword">self</span>.size.width);</div>
<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>&#160;</div>
<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>&#160;            <span class="keywordflow">if</span> (this._helper &amp;&amp; !o.animate) this._proportionallyResize();</div>
<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>&#160;        }</div>
<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>&#160;</div>
<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>&#160;        $(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&#39;cursor&#39;</span>, <span class="stringliteral">&#39;auto&#39;</span>);</div>
<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>&#160;</div>
<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>&#160;        this.element.removeClass(<span class="stringliteral">&quot;ui-resizable-resizing&quot;</span>);</div>
<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>&#160;</div>
<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>&#160;        this._propagate(<span class="stringliteral">&quot;stop&quot;</span>, event);</div>
<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>&#160;</div>
<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>&#160;        <span class="keywordflow">if</span> (this._helper) this.helper.remove();</div>
<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>&#160;</div>
<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>&#160;    },</div>
<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>&#160;</div>
<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>&#160;    _updateVirtualBoundaries: <span class="keyword">function</span>(forceAspectRatio) {</div>
<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>&#160;        var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;</div>
<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>&#160;</div>
<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>&#160;        b = {</div>
<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>&#160;            minWidth: isNumber(o.minWidth) ? o.minWidth : 0,</div>
<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>&#160;            maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,</div>
<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>&#160;            minHeight: isNumber(o.minHeight) ? o.minHeight : 0,</div>
<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>&#160;            maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity</div>
<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span>&#160;        };</div>
<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>&#160;</div>
<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>&#160;        <span class="keywordflow">if</span>(this._aspectRatio || forceAspectRatio) {</div>
<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>&#160;            <span class="comment">// We want to create an enclosing box whose aspect ration is the requested one</span></div>
<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>&#160;            <span class="comment">// First, compute the &quot;projected&quot; size for each dimension based on the aspect ratio and other dimension</span></div>
<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>&#160;            pMinWidth = b.minHeight * this.aspectRatio;</div>
<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>&#160;            pMinHeight = b.minWidth / this.aspectRatio;</div>
<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>&#160;            pMaxWidth = b.maxHeight * this.aspectRatio;</div>
<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>&#160;            pMaxHeight = b.maxWidth / this.aspectRatio;</div>
<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>&#160;</div>
<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>&#160;            <span class="keywordflow">if</span>(pMinWidth &gt; b.minWidth) b.minWidth = pMinWidth;</div>
<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>&#160;            <span class="keywordflow">if</span>(pMinHeight &gt; b.minHeight) b.minHeight = pMinHeight;</div>
<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>&#160;            <span class="keywordflow">if</span>(pMaxWidth &lt; b.maxWidth) b.maxWidth = pMaxWidth;</div>
<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>&#160;            <span class="keywordflow">if</span>(pMaxHeight &lt; b.maxHeight) b.maxHeight = pMaxHeight;</div>
<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>&#160;        }</div>
<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>&#160;        this._vBoundaries = b;</div>
<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>&#160;    },</div>
<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>&#160;</div>
<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>&#160;    _updateCache: <span class="keyword">function</span>(data) {</div>
<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>&#160;        this.offset = this.helper.offset();</div>
<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>&#160;        <span class="keywordflow">if</span> (isNumber(data.left)) this.position.left = data.left;</div>
<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>&#160;        <span class="keywordflow">if</span> (isNumber(data.top)) this.position.top = data.top;</div>
<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>&#160;        <span class="keywordflow">if</span> (isNumber(data.height)) this.size.height = data.height;</div>
<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>&#160;        <span class="keywordflow">if</span> (isNumber(data.width)) this.size.width = data.width;</div>
<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>&#160;    },</div>
<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>&#160;</div>
<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>&#160;    _updateRatio: <span class="keyword">function</span>(data, event) {</div>
<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>&#160;</div>
<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>&#160;        var o = this.options, cpos = this.position, csize = this.size, a = this.axis;</div>
<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>&#160;</div>
<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>&#160;        <span class="keywordflow">if</span> (isNumber(data.height)) data.width = (data.height * <span class="keyword">this</span>.aspectRatio);</div>
<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (isNumber(data.width)) data.height = (data.width / <span class="keyword">this</span>.aspectRatio);</div>
<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>&#160;</div>
<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>&#160;        <span class="keywordflow">if</span> (a == <span class="stringliteral">&#39;sw&#39;</span>) {</div>
<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>&#160;            data.left = cpos.left + (csize.width - data.width);</div>
<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>&#160;            data.top = null;</div>
<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>&#160;        }</div>
<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>&#160;        <span class="keywordflow">if</span> (a == <span class="stringliteral">&#39;nw&#39;</span>) {</div>
<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>&#160;            data.top = cpos.top + (csize.height - data.height);</div>
<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>&#160;            data.left = cpos.left + (csize.width - data.width);</div>
<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>&#160;        }</div>
<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>&#160;</div>
<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>&#160;        <span class="keywordflow">return</span> data;</div>
<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>&#160;    },</div>
<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>&#160;</div>
<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>&#160;    _respectSize: <span class="keyword">function</span>(data, event) {</div>
<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>&#160;</div>
<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>&#160;        var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || <span class="keyword">event</span>.shiftKey, a = this.axis,</div>
<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>&#160;                ismaxw = isNumber(data.width) &amp;&amp; o.maxWidth &amp;&amp; (o.maxWidth &lt; data.width), ismaxh = isNumber(data.height) &amp;&amp; o.maxHeight &amp;&amp; (o.maxHeight &lt; data.height),</div>
<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>&#160;                    isminw = isNumber(data.width) &amp;&amp; o.minWidth &amp;&amp; (o.minWidth &gt; data.width), isminh = isNumber(data.height) &amp;&amp; o.minHeight &amp;&amp; (o.minHeight &gt; data.height);</div>
<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>&#160;</div>
<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>&#160;        <span class="keywordflow">if</span> (isminw) data.width = o.minWidth;</div>
<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>&#160;        <span class="keywordflow">if</span> (isminh) data.height = o.minHeight;</div>
<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>&#160;        <span class="keywordflow">if</span> (ismaxw) data.width = o.maxWidth;</div>
<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>&#160;        <span class="keywordflow">if</span> (ismaxh) data.height = o.maxHeight;</div>
<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>&#160;</div>
<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>&#160;        var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;</div>
<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>&#160;        var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);</div>
<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>&#160;</div>
<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>&#160;        <span class="keywordflow">if</span> (isminw &amp;&amp; cw) data.left = dw - o.minWidth;</div>
<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>&#160;        <span class="keywordflow">if</span> (ismaxw &amp;&amp; cw) data.left = dw - o.maxWidth;</div>
<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>&#160;        <span class="keywordflow">if</span> (isminh &amp;&amp; ch)   data.top = dh - o.minHeight;</div>
<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>&#160;        <span class="keywordflow">if</span> (ismaxh &amp;&amp; ch)   data.top = dh - o.maxHeight;</div>
<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>&#160;</div>
<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>&#160;        <span class="comment">// fixing jump error on top/left - bug #2330</span></div>
<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>&#160;        var isNotwh = !data.width &amp;&amp; !data.height;</div>
<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>&#160;        <span class="keywordflow">if</span> (isNotwh &amp;&amp; !data.left &amp;&amp; data.top) data.top = null;</div>
<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (isNotwh &amp;&amp; !data.top &amp;&amp; data.left) data.left = null;</div>
<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>&#160;</div>
<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>&#160;        <span class="keywordflow">return</span> data;</div>
<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>&#160;    },</div>
<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>&#160;</div>
<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>&#160;    _proportionallyResize: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>&#160;</div>
<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>&#160;        <span class="keywordflow">if</span> (!this._proportionallyResizeElements.length) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>&#160;        var element = this.helper || this.element;</div>
<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>&#160;</div>
<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>&#160;        <span class="keywordflow">for</span> (var i=0; i &lt; this._proportionallyResizeElements.length; i++) {</div>
<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>&#160;</div>
<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>&#160;            var prel = this._proportionallyResizeElements[i];</div>
<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span>&#160;</div>
<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>&#160;            <span class="keywordflow">if</span> (!this.borderDif) {</div>
<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>&#160;                var b = [prel.css(<span class="stringliteral">&#39;borderTopWidth&#39;</span>), prel.css(<span class="stringliteral">&#39;borderRightWidth&#39;</span>), prel.css(<span class="stringliteral">&#39;borderBottomWidth&#39;</span>), prel.css(<span class="stringliteral">&#39;borderLeftWidth&#39;</span>)],</div>
<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>&#160;                    p = [prel.css(<span class="stringliteral">&#39;paddingTop&#39;</span>), prel.css(<span class="stringliteral">&#39;paddingRight&#39;</span>), prel.css(<span class="stringliteral">&#39;paddingBottom&#39;</span>), prel.css(<span class="stringliteral">&#39;paddingLeft&#39;</span>)];</div>
<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>&#160;</div>
<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>&#160;                this.borderDif = $.map(b, <span class="keyword">function</span>(v, i) {</div>
<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>&#160;                    var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;</div>
<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>&#160;                    <span class="keywordflow">return</span> border + padding;</div>
<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>&#160;                });</div>
<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>&#160;            }</div>
<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>&#160;</div>
<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>&#160;            <span class="keywordflow">if</span> ($.browser.msie &amp;&amp; !(!($(element).is(<span class="stringliteral">&#39;:hidden&#39;</span>) || $(element).parents(<span class="stringliteral">&#39;:hidden&#39;</span>).length)))</div>
<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>&#160;</div>
<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>&#160;            prel.css({</div>
<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>&#160;                height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,</div>
<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>&#160;                width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0</div>
<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>&#160;            });</div>
<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>&#160;</div>
<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>&#160;        };</div>
<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>&#160;</div>
<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>&#160;    },</div>
<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>&#160;</div>
<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>&#160;    _renderProxy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>&#160;</div>
<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span>&#160;        var el = this.element, o = this.options;</div>
<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>&#160;        this.elementOffset = el.offset();</div>
<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>&#160;</div>
<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>&#160;        <span class="keywordflow">if</span>(this._helper) {</div>
<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span>&#160;</div>
<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>&#160;            this.helper = this.helper || $(<span class="stringliteral">&#39;&lt;div style=&quot;overflow:hidden;&quot;&gt;&lt;/div&gt;&#39;</span>);</div>
<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>&#160;</div>
<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span>&#160;            <span class="comment">// fix ie6 offset TODO: This seems broken</span></div>
<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>&#160;            var ie6 = $.browser.msie &amp;&amp; $.browser.version &lt; 7, ie6offset = (ie6 ? 1 : 0),</div>
<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>&#160;            pxyoffset = ( ie6 ? 2 : -1 );</div>
<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>&#160;</div>
<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>&#160;            this.helper.addClass(this._helper).css({</div>
<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>&#160;                width: this.element.outerWidth() + pxyoffset,</div>
<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>&#160;                height: this.element.outerHeight() + pxyoffset,</div>
<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>&#160;                position: <span class="stringliteral">&#39;absolute&#39;</span>,</div>
<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>&#160;                left: this.elementOffset.left - ie6offset +<span class="stringliteral">&#39;px&#39;</span>,</div>
<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>&#160;                top: this.elementOffset.top - ie6offset +<span class="stringliteral">&#39;px&#39;</span>,</div>
<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>&#160;                zIndex: ++o.zIndex <span class="comment">//TODO: Don&#39;t modify option</span></div>
<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>&#160;            });</div>
<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>&#160;</div>
<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>&#160;            this.helper</div>
<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>&#160;                .appendTo(<span class="stringliteral">&quot;body&quot;</span>)</div>
<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>&#160;                .disableSelection();</div>
<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>&#160;</div>
<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>&#160;            this.helper = this.element;</div>
<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>&#160;        }</div>
<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span>&#160;</div>
<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>&#160;    },</div>
<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>&#160;</div>
<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>&#160;    _change: {</div>
<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>&#160;        e: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>&#160;            <span class="keywordflow">return</span> { width: this.originalSize.width + dx };</div>
<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>&#160;        },</div>
<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span>&#160;        w: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>&#160;            var o = this.options, cs = this.originalSize, sp = this.originalPosition;</div>
<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>&#160;            <span class="keywordflow">return</span> { left: sp.left + dx, width: cs.width - dx };</div>
<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>&#160;        },</div>
<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>&#160;        n: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>&#160;            var o = this.options, cs = this.originalSize, sp = this.originalPosition;</div>
<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>&#160;            <span class="keywordflow">return</span> { top: sp.top + dy, height: cs.height - dy };</div>
<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>&#160;        },</div>
<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>&#160;        s: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>&#160;            <span class="keywordflow">return</span> { height: this.originalSize.height + dy };</div>
<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>&#160;        },</div>
<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span>&#160;        se: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>&#160;            <span class="keywordflow">return</span> $.extend(this._change.s.apply(<span class="keyword">this</span>, arguments), this._change.e.apply(<span class="keyword">this</span>, [event, dx, dy]));</div>
<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>&#160;        },</div>
<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>&#160;        sw: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>&#160;            <span class="keywordflow">return</span> $.extend(this._change.s.apply(<span class="keyword">this</span>, arguments), this._change.w.apply(<span class="keyword">this</span>, [event, dx, dy]));</div>
<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>&#160;        },</div>
<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>&#160;        ne: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>&#160;            <span class="keywordflow">return</span> $.extend(this._change.n.apply(<span class="keyword">this</span>, arguments), this._change.e.apply(<span class="keyword">this</span>, [event, dx, dy]));</div>
<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>&#160;        },</div>
<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>&#160;        nw: <span class="keyword">function</span>(event, dx, dy) {</div>
<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>&#160;            <span class="keywordflow">return</span> $.extend(this._change.n.apply(<span class="keyword">this</span>, arguments), this._change.w.apply(<span class="keyword">this</span>, [event, dx, dy]));</div>
<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>&#160;        }</div>
<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>&#160;    },</div>
<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>&#160;</div>
<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span>&#160;    _propagate: <span class="keyword">function</span>(n, event) {</div>
<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>&#160;        $.ui.plugin.call(<span class="keyword">this</span>, n, [event, this.ui()]);</div>
<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>&#160;        (n != <span class="stringliteral">&quot;resize&quot;</span> &amp;&amp; this._trigger(n, event, this.ui()));</div>
<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>&#160;    },</div>
<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>&#160;</div>
<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>&#160;    plugins: {},</div>
<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>&#160;</div>
<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>&#160;    ui: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>&#160;            originalElement: this.originalElement,</div>
<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>&#160;            element: this.element,</div>
<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>&#160;            helper: this.helper,</div>
<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>&#160;            position: this.position,</div>
<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>&#160;            size: this.size,</div>
<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>&#160;            originalSize: this.originalSize,</div>
<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>&#160;            originalPosition: this.originalPosition</div>
<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>&#160;        };</div>
<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>&#160;    }</div>
<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>&#160;</div>
<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>&#160;});</div>
<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span>&#160;</div>
<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>&#160;$.extend($.ui.resizable, {</div>
<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>&#160;});</div>
<div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>&#160;</div>
<div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l02367"></a><span class="lineno"> 2367</span>&#160;<span class="comment"> * Resizable Extensions</span></div>
<div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>&#160;</div>
<div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;resizable&quot;</span>, <span class="stringliteral">&quot;alsoResize&quot;</span>, {</div>
<div class="line"><a name="l02371"></a><span class="lineno"> 2371</span>&#160;</div>
<div class="line"><a name="l02372"></a><span class="lineno"> 2372</span>&#160;    start: <span class="keyword">function</span> (event, ui) {</div>
<div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>&#160;</div>
<div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>&#160;        var _store = <span class="keyword">function</span> (exp) {</div>
<div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>&#160;            $(exp).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02377"></a><span class="lineno"> 2377</span>&#160;                var el = $(<span class="keyword">this</span>);</div>
<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>&#160;                el.data(<span class="stringliteral">&quot;resizable-alsoresize&quot;</span>, {</div>
<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>&#160;                    width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),</div>
<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>&#160;                    left: parseInt(el.css(<span class="stringliteral">&#39;left&#39;</span>), 10), top: parseInt(el.css(<span class="stringliteral">&#39;top&#39;</span>), 10)</div>
<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>&#160;                });</div>
<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>&#160;            });</div>
<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>&#160;        };</div>
<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>&#160;</div>
<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>&#160;        <span class="keywordflow">if</span> (typeof(o.alsoResize) == <span class="stringliteral">&#39;object&#39;</span> &amp;&amp; !o.alsoResize.parentNode) {</div>
<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>&#160;            <span class="keywordflow">if</span> (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }</div>
<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>&#160;            <span class="keywordflow">else</span> { $.each(o.alsoResize, function (exp) { _store(exp); }); }</div>
<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>&#160;        }<span class="keywordflow">else</span>{</div>
<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span>&#160;            _store(o.alsoResize);</div>
<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>&#160;        }</div>
<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>&#160;    },</div>
<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>&#160;</div>
<div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>&#160;    resize: <span class="keyword">function</span> (event, ui) {</div>
<div class="line"><a name="l02394"></a><span class="lineno"> 2394</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options, os = <span class="keyword">self</span>.originalSize, op = <span class="keyword">self</span>.originalPosition;</div>
<div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>&#160;</div>
<div class="line"><a name="l02396"></a><span class="lineno"> 2396</span>&#160;        var delta = {</div>
<div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>&#160;            height: (<span class="keyword">self</span>.size.height - os.height) || 0, width: (<span class="keyword">self</span>.size.width - os.width) || 0,</div>
<div class="line"><a name="l02398"></a><span class="lineno"> 2398</span>&#160;            top: (<span class="keyword">self</span>.position.top - op.top) || 0, left: (<span class="keyword">self</span>.position.left - op.left) || 0</div>
<div class="line"><a name="l02399"></a><span class="lineno"> 2399</span>&#160;        },</div>
<div class="line"><a name="l02400"></a><span class="lineno"> 2400</span>&#160;</div>
<div class="line"><a name="l02401"></a><span class="lineno"> 2401</span>&#160;        _alsoResize = <span class="keyword">function</span> (exp, c) {</div>
<div class="line"><a name="l02402"></a><span class="lineno"> 2402</span>&#160;            $(exp).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02403"></a><span class="lineno"> 2403</span>&#160;                var el = $(<span class="keyword">this</span>), start = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable-alsoresize&quot;</span>), style = {}, </div>
<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>&#160;                    css = c &amp;&amp; c.length ? c : el.parents(ui.originalElement[0]).length ? [<span class="stringliteral">&#39;width&#39;</span>, <span class="stringliteral">&#39;height&#39;</span>] : [<span class="stringliteral">&#39;width&#39;</span>, <span class="stringliteral">&#39;height&#39;</span>, <span class="stringliteral">&#39;top&#39;</span>, <span class="stringliteral">&#39;left&#39;</span>];</div>
<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>&#160;</div>
<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>&#160;                $.each(css, <span class="keyword">function</span> (i, prop) {</div>
<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>&#160;                    var sum = (start[prop]||0) + (delta[prop]||0);</div>
<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>&#160;                    <span class="keywordflow">if</span> (sum &amp;&amp; sum &gt;= 0)</div>
<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span>&#160;                        style[prop] = sum || null;</div>
<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>&#160;                });</div>
<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>&#160;</div>
<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>&#160;                el.css(style);</div>
<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>&#160;            });</div>
<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>&#160;        };</div>
<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>&#160;</div>
<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>&#160;        <span class="keywordflow">if</span> (typeof(o.alsoResize) == <span class="stringliteral">&#39;object&#39;</span> &amp;&amp; !o.alsoResize.nodeType) {</div>
<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>&#160;            $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });</div>
<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>&#160;        }<span class="keywordflow">else</span>{</div>
<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>&#160;            _alsoResize(o.alsoResize);</div>
<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span>&#160;        }</div>
<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>&#160;    },</div>
<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>&#160;</div>
<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>&#160;    stop: <span class="keyword">function</span> (event, ui) {</div>
<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>&#160;        $(<span class="keyword">this</span>).removeData(<span class="stringliteral">&quot;resizable-alsoresize&quot;</span>);</div>
<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>&#160;    }</div>
<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>&#160;});</div>
<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>&#160;</div>
<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;resizable&quot;</span>, <span class="stringliteral">&quot;animate&quot;</span>, {</div>
<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>&#160;</div>
<div class="line"><a name="l02430"></a><span class="lineno"> 2430</span>&#160;    stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>&#160;</div>
<div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>&#160;        var pr = <span class="keyword">self</span>._proportionallyResizeElements, ista = pr.length &amp;&amp; (/textarea/i).test(pr[0].nodeName),</div>
<div class="line"><a name="l02434"></a><span class="lineno"> 2434</span>&#160;                    soffseth = ista &amp;&amp; $.ui.hasScroll(pr[0], <span class="stringliteral">&#39;left&#39;</span>) <span class="comment">/* TODO - jump height */</span> ? 0 : <span class="keyword">self</span>.sizeDiff.height,</div>
<div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>&#160;                        soffsetw = ista ? 0 : <span class="keyword">self</span>.sizeDiff.width;</div>
<div class="line"><a name="l02436"></a><span class="lineno"> 2436</span>&#160;</div>
<div class="line"><a name="l02437"></a><span class="lineno"> 2437</span>&#160;        var style = { width: (<span class="keyword">self</span>.size.width - soffsetw), height: (<span class="keyword">self</span>.size.height - soffseth) },</div>
<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>&#160;                    left = (parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;left&#39;</span>), 10) + (<span class="keyword">self</span>.position.left - <span class="keyword">self</span>.originalPosition.left)) || null,</div>
<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>&#160;                        top = (parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;top&#39;</span>), 10) + (<span class="keyword">self</span>.position.top - <span class="keyword">self</span>.originalPosition.top)) || null;</div>
<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span>&#160;</div>
<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span>&#160;        <span class="keyword">self</span>.element.animate(</div>
<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>&#160;            $.extend(style, top &amp;&amp; left ? { top: top, left: left } : {}), {</div>
<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span>&#160;                duration: o.animateDuration,</div>
<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span>&#160;                easing: o.animateEasing,</div>
<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>&#160;                step: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>&#160;</div>
<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>&#160;                    var data = {</div>
<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>&#160;                        width: parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;width&#39;</span>), 10),</div>
<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span>&#160;                        height: parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;height&#39;</span>), 10),</div>
<div class="line"><a name="l02450"></a><span class="lineno"> 2450</span>&#160;                        top: parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;top&#39;</span>), 10),</div>
<div class="line"><a name="l02451"></a><span class="lineno"> 2451</span>&#160;                        left: parseInt(<span class="keyword">self</span>.element.css(<span class="stringliteral">&#39;left&#39;</span>), 10)</div>
<div class="line"><a name="l02452"></a><span class="lineno"> 2452</span>&#160;                    };</div>
<div class="line"><a name="l02453"></a><span class="lineno"> 2453</span>&#160;</div>
<div class="line"><a name="l02454"></a><span class="lineno"> 2454</span>&#160;                    <span class="keywordflow">if</span> (pr &amp;&amp; pr.length) $(pr[0]).css({ width: data.width, height: data.height });</div>
<div class="line"><a name="l02455"></a><span class="lineno"> 2455</span>&#160;</div>
<div class="line"><a name="l02456"></a><span class="lineno"> 2456</span>&#160;                    <span class="comment">// propagating resize, and updating values for each animation step</span></div>
<div class="line"><a name="l02457"></a><span class="lineno"> 2457</span>&#160;                    <span class="keyword">self</span>._updateCache(data);</div>
<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>&#160;                    <span class="keyword">self</span>._propagate(<span class="stringliteral">&quot;resize&quot;</span>, event);</div>
<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span>&#160;</div>
<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span>&#160;                }</div>
<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>&#160;            }</div>
<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span>&#160;        );</div>
<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span>&#160;    }</div>
<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span>&#160;</div>
<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span>&#160;});</div>
<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>&#160;</div>
<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;resizable&quot;</span>, <span class="stringliteral">&quot;containment&quot;</span>, {</div>
<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span>&#160;</div>
<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options, el = <span class="keyword">self</span>.element;</div>
<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>&#160;        var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;</div>
<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>&#160;        <span class="keywordflow">if</span> (!ce) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>&#160;</div>
<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>&#160;        <span class="keyword">self</span>.containerElement = $(ce);</div>
<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span>&#160;</div>
<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>&#160;        <span class="keywordflow">if</span> (/document/.test(oc) || oc == document) {</div>
<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>&#160;            <span class="keyword">self</span>.containerOffset = { left: 0, top: 0 };</div>
<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>&#160;            <span class="keyword">self</span>.containerPosition = { left: 0, top: 0 };</div>
<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>&#160;</div>
<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>&#160;            <span class="keyword">self</span>.parentData = {</div>
<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>&#160;                element: $(document), left: 0, top: 0,</div>
<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>&#160;                width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight</div>
<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>&#160;            };</div>
<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span>&#160;        }</div>
<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>&#160;</div>
<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span>&#160;        <span class="comment">// i&#39;m a node, so compute top, left, right, bottom</span></div>
<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span>&#160;            var element = $(ce), p = [];</div>
<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>&#160;            $([ <span class="stringliteral">&quot;Top&quot;</span>, <span class="stringliteral">&quot;Right&quot;</span>, <span class="stringliteral">&quot;Left&quot;</span>, <span class="stringliteral">&quot;Bottom&quot;</span> ]).each(<span class="keyword">function</span>(i, name) { p[i] = num(element.css(<span class="stringliteral">&quot;padding&quot;</span> + name)); });</div>
<div class="line"><a name="l02490"></a><span class="lineno"> 2490</span>&#160;</div>
<div class="line"><a name="l02491"></a><span class="lineno"> 2491</span>&#160;            <span class="keyword">self</span>.containerOffset = element.offset();</div>
<div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>&#160;            <span class="keyword">self</span>.containerPosition = element.position();</div>
<div class="line"><a name="l02493"></a><span class="lineno"> 2493</span>&#160;            <span class="keyword">self</span>.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };</div>
<div class="line"><a name="l02494"></a><span class="lineno"> 2494</span>&#160;</div>
<div class="line"><a name="l02495"></a><span class="lineno"> 2495</span>&#160;            var co = <span class="keyword">self</span>.containerOffset, ch = <span class="keyword">self</span>.containerSize.height,  cw = <span class="keyword">self</span>.containerSize.width,</div>
<div class="line"><a name="l02496"></a><span class="lineno"> 2496</span>&#160;                        width = ($.ui.hasScroll(ce, <span class="stringliteral">&quot;left&quot;</span>) ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);</div>
<div class="line"><a name="l02497"></a><span class="lineno"> 2497</span>&#160;</div>
<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>&#160;            <span class="keyword">self</span>.parentData = {</div>
<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>&#160;                element: ce, left: co.left, top: co.top, width: width, height: height</div>
<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span>&#160;            };</div>
<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>&#160;        }</div>
<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>&#160;    },</div>
<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span>&#160;</div>
<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span>&#160;    resize: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options,</div>
<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>&#160;                ps = <span class="keyword">self</span>.containerSize, co = <span class="keyword">self</span>.containerOffset, cs = <span class="keyword">self</span>.size, cp = <span class="keyword">self</span>.position,</div>
<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span>&#160;                pRatio = <span class="keyword">self</span>._aspectRatio || <span class="keyword">event</span>.shiftKey, cop = { top:0, left:0 }, ce = <span class="keyword">self</span>.containerElement;</div>
<div class="line"><a name="l02508"></a><span class="lineno"> 2508</span>&#160;</div>
<div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>&#160;        <span class="keywordflow">if</span> (ce[0] != document &amp;&amp; (/<span class="keyword">static</span>/).test(ce.css(<span class="stringliteral">&#39;position&#39;</span>))) cop = co;</div>
<div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>&#160;</div>
<div class="line"><a name="l02511"></a><span class="lineno"> 2511</span>&#160;        <span class="keywordflow">if</span> (cp.left &lt; (<span class="keyword">self</span>._helper ? co.left : 0)) {</div>
<div class="line"><a name="l02512"></a><span class="lineno"> 2512</span>&#160;            <span class="keyword">self</span>.size.width = <span class="keyword">self</span>.size.width + (<span class="keyword">self</span>._helper ? (<span class="keyword">self</span>.position.left - co.left) : (<span class="keyword">self</span>.position.left - cop.left));</div>
<div class="line"><a name="l02513"></a><span class="lineno"> 2513</span>&#160;            <span class="keywordflow">if</span> (pRatio) <span class="keyword">self</span>.size.height = <span class="keyword">self</span>.size.width / <span class="keyword">self</span>.aspectRatio;</div>
<div class="line"><a name="l02514"></a><span class="lineno"> 2514</span>&#160;            <span class="keyword">self</span>.position.left = o.helper ? co.left : 0;</div>
<div class="line"><a name="l02515"></a><span class="lineno"> 2515</span>&#160;        }</div>
<div class="line"><a name="l02516"></a><span class="lineno"> 2516</span>&#160;</div>
<div class="line"><a name="l02517"></a><span class="lineno"> 2517</span>&#160;        <span class="keywordflow">if</span> (cp.top &lt; (<span class="keyword">self</span>._helper ? co.top : 0)) {</div>
<div class="line"><a name="l02518"></a><span class="lineno"> 2518</span>&#160;            <span class="keyword">self</span>.size.height = <span class="keyword">self</span>.size.height + (<span class="keyword">self</span>._helper ? (<span class="keyword">self</span>.position.top - co.top) : <span class="keyword">self</span>.position.top);</div>
<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span>&#160;            <span class="keywordflow">if</span> (pRatio) <span class="keyword">self</span>.size.width = <span class="keyword">self</span>.size.height * <span class="keyword">self</span>.aspectRatio;</div>
<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span>&#160;            <span class="keyword">self</span>.position.top = <span class="keyword">self</span>._helper ? co.top : 0;</div>
<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span>&#160;        }</div>
<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span>&#160;</div>
<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>&#160;        <span class="keyword">self</span>.offset.left = <span class="keyword">self</span>.parentData.left+<span class="keyword">self</span>.position.left;</div>
<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span>&#160;        <span class="keyword">self</span>.offset.top = <span class="keyword">self</span>.parentData.top+<span class="keyword">self</span>.position.top;</div>
<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>&#160;</div>
<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>&#160;        var woset = Math.abs( (<span class="keyword">self</span>._helper ? <span class="keyword">self</span>.offset.left - cop.left : (<span class="keyword">self</span>.offset.left - cop.left)) + <span class="keyword">self</span>.sizeDiff.width ),</div>
<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>&#160;                    hoset = Math.abs( (<span class="keyword">self</span>._helper ? <span class="keyword">self</span>.offset.top - cop.top : (<span class="keyword">self</span>.offset.top - co.top)) + <span class="keyword">self</span>.sizeDiff.height );</div>
<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span>&#160;</div>
<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>&#160;        var isParent = <span class="keyword">self</span>.containerElement.get(0) == <span class="keyword">self</span>.element.parent().get(0),</div>
<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span>&#160;            isOffsetRelative = /relative|absolute/.test(<span class="keyword">self</span>.containerElement.css(<span class="stringliteral">&#39;position&#39;</span>));</div>
<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>&#160;</div>
<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>&#160;        <span class="keywordflow">if</span>(isParent &amp;&amp; isOffsetRelative) woset -= <span class="keyword">self</span>.parentData.left;</div>
<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span>&#160;</div>
<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span>&#160;        <span class="keywordflow">if</span> (woset + <span class="keyword">self</span>.size.width &gt;= <span class="keyword">self</span>.parentData.width) {</div>
<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>&#160;            <span class="keyword">self</span>.size.width = <span class="keyword">self</span>.parentData.width - woset;</div>
<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span>&#160;            <span class="keywordflow">if</span> (pRatio) <span class="keyword">self</span>.size.height = <span class="keyword">self</span>.size.width / <span class="keyword">self</span>.aspectRatio;</div>
<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span>&#160;        }</div>
<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>&#160;</div>
<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span>&#160;        <span class="keywordflow">if</span> (hoset + <span class="keyword">self</span>.size.height &gt;= <span class="keyword">self</span>.parentData.height) {</div>
<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span>&#160;            <span class="keyword">self</span>.size.height = <span class="keyword">self</span>.parentData.height - hoset;</div>
<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>&#160;            <span class="keywordflow">if</span> (pRatio) <span class="keyword">self</span>.size.width = <span class="keyword">self</span>.size.height * <span class="keyword">self</span>.aspectRatio;</div>
<div class="line"><a name="l02542"></a><span class="lineno"> 2542</span>&#160;        }</div>
<div class="line"><a name="l02543"></a><span class="lineno"> 2543</span>&#160;    },</div>
<div class="line"><a name="l02544"></a><span class="lineno"> 2544</span>&#160;</div>
<div class="line"><a name="l02545"></a><span class="lineno"> 2545</span>&#160;    stop: <span class="keyword">function</span>(event, ui){</div>
<div class="line"><a name="l02546"></a><span class="lineno"> 2546</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options, cp = <span class="keyword">self</span>.position,</div>
<div class="line"><a name="l02547"></a><span class="lineno"> 2547</span>&#160;                co = <span class="keyword">self</span>.containerOffset, cop = <span class="keyword">self</span>.containerPosition, ce = <span class="keyword">self</span>.containerElement;</div>
<div class="line"><a name="l02548"></a><span class="lineno"> 2548</span>&#160;</div>
<div class="line"><a name="l02549"></a><span class="lineno"> 2549</span>&#160;        var helper = $(<span class="keyword">self</span>.helper), ho = helper.offset(), w = helper.outerWidth() - <span class="keyword">self</span>.sizeDiff.width, h = helper.outerHeight() - <span class="keyword">self</span>.sizeDiff.height;</div>
<div class="line"><a name="l02550"></a><span class="lineno"> 2550</span>&#160;</div>
<div class="line"><a name="l02551"></a><span class="lineno"> 2551</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>._helper &amp;&amp; !o.animate &amp;&amp; (/relative/).test(ce.css(<span class="stringliteral">&#39;position&#39;</span>)))</div>
<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span>&#160;            $(<span class="keyword">this</span>).css({ left: ho.left - cop.left - co.left, width: w, height: h });</div>
<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>&#160;</div>
<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>._helper &amp;&amp; !o.animate &amp;&amp; (/<span class="keyword">static</span>/).test(ce.css(<span class="stringliteral">&#39;position&#39;</span>)))</div>
<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span>&#160;            $(<span class="keyword">this</span>).css({ left: ho.left - cop.left - co.left, width: w, height: h });</div>
<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>&#160;</div>
<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>&#160;    }</div>
<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span>&#160;});</div>
<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span>&#160;</div>
<div class="line"><a name="l02560"></a><span class="lineno"> 2560</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;resizable&quot;</span>, <span class="stringliteral">&quot;ghost&quot;</span>, {</div>
<div class="line"><a name="l02561"></a><span class="lineno"> 2561</span>&#160;</div>
<div class="line"><a name="l02562"></a><span class="lineno"> 2562</span>&#160;    start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l02563"></a><span class="lineno"> 2563</span>&#160;</div>
<div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options, cs = <span class="keyword">self</span>.size;</div>
<div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>&#160;</div>
<div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>&#160;        <span class="keyword">self</span>.ghost = <span class="keyword">self</span>.originalElement.clone();</div>
<div class="line"><a name="l02567"></a><span class="lineno"> 2567</span>&#160;        <span class="keyword">self</span>.ghost</div>
<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span>&#160;            .css({ opacity: .25, display: <span class="stringliteral">&#39;block&#39;</span>, position: <span class="stringliteral">&#39;relative&#39;</span>, height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })</div>
<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>&#160;            .addClass(<span class="stringliteral">&#39;ui-resizable-ghost&#39;</span>)</div>
<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>&#160;            .addClass(typeof o.ghost == <span class="stringliteral">&#39;string&#39;</span> ? o.ghost : <span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>&#160;</div>
<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>&#160;        <span class="keyword">self</span>.ghost.appendTo(<span class="keyword">self</span>.helper);</div>
<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span>&#160;</div>
<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>&#160;    },</div>
<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>&#160;</div>
<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span>&#160;    resize: <span class="keyword">function</span>(event, ui){</div>
<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.ghost) <span class="keyword">self</span>.ghost.css({ position: <span class="stringliteral">&#39;relative&#39;</span>, height: <span class="keyword">self</span>.size.height, width: <span class="keyword">self</span>.size.width });</div>
<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>&#160;    },</div>
<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>&#160;</div>
<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>&#160;    stop: <span class="keyword">function</span>(event, ui){</div>
<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.ghost &amp;&amp; <span class="keyword">self</span>.helper) <span class="keyword">self</span>.helper.get(0).removeChild(<span class="keyword">self</span>.ghost.get(0));</div>
<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>&#160;    }</div>
<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span>&#160;</div>
<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>&#160;});</div>
<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>&#160;</div>
<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>&#160;$.ui.plugin.add(<span class="stringliteral">&quot;resizable&quot;</span>, <span class="stringliteral">&quot;grid&quot;</span>, {</div>
<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span>&#160;</div>
<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>&#160;    resize: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>&#160;        var <span class="keyword">self</span> = $(<span class="keyword">this</span>).data(<span class="stringliteral">&quot;resizable&quot;</span>), o = <span class="keyword">self</span>.options, cs = <span class="keyword">self</span>.size, os = <span class="keyword">self</span>.originalSize, op = <span class="keyword">self</span>.originalPosition, a = <span class="keyword">self</span>.axis, ratio = o._aspectRatio || <span class="keyword">event</span>.shiftKey;</div>
<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>&#160;        o.grid = typeof o.grid == <span class="stringliteral">&quot;number&quot;</span> ? [o.grid, o.grid] : o.grid;</div>
<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>&#160;        var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);</div>
<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>&#160;</div>
<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>&#160;        <span class="keywordflow">if</span> (/^(se|s|e)$/.test(a)) {</div>
<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>&#160;            <span class="keyword">self</span>.size.width = os.width + ox;</div>
<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>&#160;            <span class="keyword">self</span>.size.height = os.height + oy;</div>
<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>&#160;        }</div>
<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (/^(ne)$/.test(a)) {</div>
<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span>&#160;            <span class="keyword">self</span>.size.width = os.width + ox;</div>
<div class="line"><a name="l02601"></a><span class="lineno"> 2601</span>&#160;            <span class="keyword">self</span>.size.height = os.height + oy;</div>
<div class="line"><a name="l02602"></a><span class="lineno"> 2602</span>&#160;            <span class="keyword">self</span>.position.top = op.top - oy;</div>
<div class="line"><a name="l02603"></a><span class="lineno"> 2603</span>&#160;        }</div>
<div class="line"><a name="l02604"></a><span class="lineno"> 2604</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (/^(sw)$/.test(a)) {</div>
<div class="line"><a name="l02605"></a><span class="lineno"> 2605</span>&#160;            <span class="keyword">self</span>.size.width = os.width + ox;</div>
<div class="line"><a name="l02606"></a><span class="lineno"> 2606</span>&#160;            <span class="keyword">self</span>.size.height = os.height + oy;</div>
<div class="line"><a name="l02607"></a><span class="lineno"> 2607</span>&#160;            <span class="keyword">self</span>.position.left = op.left - ox;</div>
<div class="line"><a name="l02608"></a><span class="lineno"> 2608</span>&#160;        }</div>
<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span>&#160;            <span class="keyword">self</span>.size.width = os.width + ox;</div>
<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>&#160;            <span class="keyword">self</span>.size.height = os.height + oy;</div>
<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>&#160;            <span class="keyword">self</span>.position.top = op.top - oy;</div>
<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>&#160;            <span class="keyword">self</span>.position.left = op.left - ox;</div>
<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>&#160;        }</div>
<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span>&#160;    }</div>
<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>&#160;</div>
<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span>&#160;});</div>
<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span>&#160;</div>
<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>&#160;var num = <span class="keyword">function</span>(v) {</div>
<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span>&#160;    <span class="keywordflow">return</span> parseInt(v, 10) || 0;</div>
<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>&#160;};</div>
<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>&#160;</div>
<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span>&#160;var isNumber = <span class="keyword">function</span>(value) {</div>
<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span>&#160;    <span class="keywordflow">return</span> !isNaN(parseInt(value, 10));</div>
<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span>&#160;};</div>
<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span>&#160;</div>
<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>&#160;})(jQuery);</div>
<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span>&#160;</div>
<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span>&#160;</div>
<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>&#160;$.widget(<span class="stringliteral">&quot;ui.selectable&quot;</span>, $.ui.mouse, {</div>
<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span>&#160;    options: {</div>
<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span>&#160;        appendTo: <span class="stringliteral">&#39;body&#39;</span>,</div>
<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span>&#160;        autoRefresh: <span class="keyword">true</span>,</div>
<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>&#160;        distance: 0,</div>
<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span>&#160;        filter: <span class="charliteral">&#39;*&#39;</span>,</div>
<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>&#160;        tolerance: <span class="stringliteral">&#39;touch&#39;</span></div>
<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>&#160;    },</div>
<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>&#160;</div>
<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>&#160;        this.element.addClass(<span class="stringliteral">&quot;ui-selectable&quot;</span>);</div>
<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>&#160;</div>
<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>&#160;        this.dragged = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>&#160;</div>
<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>&#160;        <span class="comment">// cache selectee children based on filter</span></div>
<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span>&#160;        var selectees;</div>
<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span>&#160;        this.refresh = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>&#160;            selectees = $(<span class="keyword">self</span>.options.filter, <span class="keyword">self</span>.element[0]);</div>
<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span>&#160;            selectees.addClass(<span class="stringliteral">&quot;ui-selectee&quot;</span>);</div>
<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span>&#160;            selectees.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span>&#160;                var $this = $(<span class="keyword">this</span>);</div>
<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>&#160;                var pos = $this.offset();</div>
<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>&#160;                $.data(<span class="keyword">this</span>, <span class="stringliteral">&quot;selectable-item&quot;</span>, {</div>
<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span>&#160;                    element: <span class="keyword">this</span>,</div>
<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>&#160;                    $element: $this,</div>
<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>&#160;                    left: pos.left,</div>
<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>&#160;                    top: pos.top,</div>
<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span>&#160;                    right: pos.left + $this.outerWidth(),</div>
<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>&#160;                    bottom: pos.top + $this.outerHeight(),</div>
<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span>&#160;                    startselected: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span>&#160;                    selected: $this.hasClass(<span class="stringliteral">&#39;ui-selected&#39;</span>),</div>
<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span>&#160;                    selecting: $this.hasClass(<span class="stringliteral">&#39;ui-selecting&#39;</span>),</div>
<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span>&#160;                    unselecting: $this.hasClass(<span class="stringliteral">&#39;ui-unselecting&#39;</span>)</div>
<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span>&#160;                });</div>
<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span>&#160;            });</div>
<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span>&#160;        };</div>
<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span>&#160;        this.refresh();</div>
<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span>&#160;</div>
<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span>&#160;        this.selectees = selectees.addClass(<span class="stringliteral">&quot;ui-selectee&quot;</span>);</div>
<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span>&#160;</div>
<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span>&#160;        this._mouseInit();</div>
<div class="line"><a name="l02673"></a><span class="lineno"> 2673</span>&#160;</div>
<div class="line"><a name="l02674"></a><span class="lineno"> 2674</span>&#160;        this.helper = $(<span class="stringliteral">&quot;&lt;div class=&#39;ui-selectable-helper&#39;&gt;&lt;/div&gt;&quot;</span>);</div>
<div class="line"><a name="l02675"></a><span class="lineno"> 2675</span>&#160;    },</div>
<div class="line"><a name="l02676"></a><span class="lineno"> 2676</span>&#160;</div>
<div class="line"><a name="l02677"></a><span class="lineno"> 2677</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02678"></a><span class="lineno"> 2678</span>&#160;        this.selectees</div>
<div class="line"><a name="l02679"></a><span class="lineno"> 2679</span>&#160;            .removeClass(<span class="stringliteral">&quot;ui-selectee&quot;</span>)</div>
<div class="line"><a name="l02680"></a><span class="lineno"> 2680</span>&#160;            .removeData(<span class="stringliteral">&quot;selectable-item&quot;</span>);</div>
<div class="line"><a name="l02681"></a><span class="lineno"> 2681</span>&#160;        this.element</div>
<div class="line"><a name="l02682"></a><span class="lineno"> 2682</span>&#160;            .removeClass(<span class="stringliteral">&quot;ui-selectable ui-selectable-disabled&quot;</span>)</div>
<div class="line"><a name="l02683"></a><span class="lineno"> 2683</span>&#160;            .removeData(<span class="stringliteral">&quot;selectable&quot;</span>)</div>
<div class="line"><a name="l02684"></a><span class="lineno"> 2684</span>&#160;            .unbind(<span class="stringliteral">&quot;.selectable&quot;</span>);</div>
<div class="line"><a name="l02685"></a><span class="lineno"> 2685</span>&#160;        this._mouseDestroy();</div>
<div class="line"><a name="l02686"></a><span class="lineno"> 2686</span>&#160;</div>
<div class="line"><a name="l02687"></a><span class="lineno"> 2687</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l02688"></a><span class="lineno"> 2688</span>&#160;    },</div>
<div class="line"><a name="l02689"></a><span class="lineno"> 2689</span>&#160;</div>
<div class="line"><a name="l02690"></a><span class="lineno"> 2690</span>&#160;    _mouseStart: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>&#160;</div>
<div class="line"><a name="l02693"></a><span class="lineno"> 2693</span>&#160;        this.opos = [<span class="keyword">event</span>.pageX, <span class="keyword">event</span>.pageY];</div>
<div class="line"><a name="l02694"></a><span class="lineno"> 2694</span>&#160;</div>
<div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>&#160;        <span class="keywordflow">if</span> (this.options.disabled)</div>
<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span>&#160;</div>
<div class="line"><a name="l02698"></a><span class="lineno"> 2698</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>&#160;</div>
<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>&#160;        this.selectees = $(options.filter, this.element[0]);</div>
<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>&#160;</div>
<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>&#160;        this._trigger(<span class="stringliteral">&quot;start&quot;</span>, event);</div>
<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>&#160;</div>
<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>&#160;        $(options.appendTo).append(this.helper);</div>
<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>&#160;        <span class="comment">// position helper (lasso)</span></div>
<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span>&#160;        this.helper.css({</div>
<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>&#160;            <span class="stringliteral">&quot;left&quot;</span>: <span class="keyword">event</span>.clientX,</div>
<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>&#160;            <span class="stringliteral">&quot;top&quot;</span>: <span class="keyword">event</span>.clientY,</div>
<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span>&#160;            <span class="stringliteral">&quot;width&quot;</span>: 0,</div>
<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>&#160;            <span class="stringliteral">&quot;height&quot;</span>: 0</div>
<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>&#160;        });</div>
<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>&#160;</div>
<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span>&#160;        <span class="keywordflow">if</span> (options.autoRefresh) {</div>
<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span>&#160;            this.refresh();</div>
<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span>&#160;        }</div>
<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span>&#160;</div>
<div class="line"><a name="l02717"></a><span class="lineno"> 2717</span>&#160;        this.selectees.filter(<span class="stringliteral">&#39;.ui-selected&#39;</span>).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02718"></a><span class="lineno"> 2718</span>&#160;            var selectee = $.data(<span class="keyword">this</span>, <span class="stringliteral">&quot;selectable-item&quot;</span>);</div>
<div class="line"><a name="l02719"></a><span class="lineno"> 2719</span>&#160;            selectee.startselected = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02720"></a><span class="lineno"> 2720</span>&#160;            <span class="keywordflow">if</span> (!event.metaKey &amp;&amp; !event.ctrlKey) {</div>
<div class="line"><a name="l02721"></a><span class="lineno"> 2721</span>&#160;                selectee.$element.removeClass(<span class="stringliteral">&#39;ui-selected&#39;</span>);</div>
<div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>&#160;                selectee.selected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>&#160;                selectee.$element.addClass(<span class="stringliteral">&#39;ui-unselecting&#39;</span>);</div>
<div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>&#160;                selectee.unselecting = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02725"></a><span class="lineno"> 2725</span>&#160;                <span class="comment">// selectable UNSELECTING callback</span></div>
<div class="line"><a name="l02726"></a><span class="lineno"> 2726</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;unselecting&quot;</span>, event, {</div>
<div class="line"><a name="l02727"></a><span class="lineno"> 2727</span>&#160;                    unselecting: selectee.element</div>
<div class="line"><a name="l02728"></a><span class="lineno"> 2728</span>&#160;                });</div>
<div class="line"><a name="l02729"></a><span class="lineno"> 2729</span>&#160;            }</div>
<div class="line"><a name="l02730"></a><span class="lineno"> 2730</span>&#160;        });</div>
<div class="line"><a name="l02731"></a><span class="lineno"> 2731</span>&#160;</div>
<div class="line"><a name="l02732"></a><span class="lineno"> 2732</span>&#160;        $(<span class="keyword">event</span>.target).parents().andSelf().each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02733"></a><span class="lineno"> 2733</span>&#160;            var selectee = $.data(<span class="keyword">this</span>, <span class="stringliteral">&quot;selectable-item&quot;</span>);</div>
<div class="line"><a name="l02734"></a><span class="lineno"> 2734</span>&#160;            <span class="keywordflow">if</span> (selectee) {</div>
<div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>&#160;                var doSelect = (!<span class="keyword">event</span>.metaKey &amp;&amp; !<span class="keyword">event</span>.ctrlKey) || !selectee.$element.hasClass(<span class="stringliteral">&#39;ui-selected&#39;</span>);</div>
<div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>&#160;                selectee.$element</div>
<div class="line"><a name="l02737"></a><span class="lineno"> 2737</span>&#160;                    .removeClass(doSelect ? <span class="stringliteral">&quot;ui-unselecting&quot;</span> : <span class="stringliteral">&quot;ui-selected&quot;</span>)</div>
<div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>&#160;                    .addClass(doSelect ? <span class="stringliteral">&quot;ui-selecting&quot;</span> : <span class="stringliteral">&quot;ui-unselecting&quot;</span>);</div>
<div class="line"><a name="l02739"></a><span class="lineno"> 2739</span>&#160;                selectee.unselecting = !doSelect;</div>
<div class="line"><a name="l02740"></a><span class="lineno"> 2740</span>&#160;                selectee.selecting = doSelect;</div>
<div class="line"><a name="l02741"></a><span class="lineno"> 2741</span>&#160;                selectee.selected = doSelect;</div>
<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>&#160;                <span class="comment">// selectable (UN)SELECTING callback</span></div>
<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span>&#160;                <span class="keywordflow">if</span> (doSelect) {</div>
<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>&#160;                    <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;selecting&quot;</span>, event, {</div>
<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span>&#160;                        selecting: selectee.element</div>
<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span>&#160;                    });</div>
<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span>&#160;                    <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;unselecting&quot;</span>, event, {</div>
<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>&#160;                        unselecting: selectee.element</div>
<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span>&#160;                    });</div>
<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>&#160;                }</div>
<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>&#160;            }</div>
<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>&#160;        });</div>
<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span>&#160;</div>
<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>&#160;    },</div>
<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>&#160;</div>
<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span>&#160;    _mouseDrag: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span>&#160;        this.dragged = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>&#160;</div>
<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>&#160;        <span class="keywordflow">if</span> (this.options.disabled)</div>
<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span>&#160;</div>
<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>&#160;</div>
<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>&#160;        var x1 = this.opos[0], y1 = this.opos[1], x2 = <span class="keyword">event</span>.pageX, y2 = <span class="keyword">event</span>.pageY;</div>
<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>&#160;        <span class="keywordflow">if</span> (x1 &gt; x2) { var tmp = x2; x2 = x1; x1 = tmp; }</div>
<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>&#160;        <span class="keywordflow">if</span> (y1 &gt; y2) { var tmp = y2; y2 = y1; y1 = tmp; }</div>
<div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>&#160;        this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});</div>
<div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>&#160;</div>
<div class="line"><a name="l02772"></a><span class="lineno"> 2772</span>&#160;        this.selectees.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02773"></a><span class="lineno"> 2773</span>&#160;            var selectee = $.data(<span class="keyword">this</span>, <span class="stringliteral">&quot;selectable-item&quot;</span>);</div>
<div class="line"><a name="l02774"></a><span class="lineno"> 2774</span>&#160;            <span class="comment">//prevent helper from being selected if appendTo: selectable</span></div>
<div class="line"><a name="l02775"></a><span class="lineno"> 2775</span>&#160;            <span class="keywordflow">if</span> (!selectee || selectee.element == <span class="keyword">self</span>.element[0])</div>
<div class="line"><a name="l02776"></a><span class="lineno"> 2776</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l02777"></a><span class="lineno"> 2777</span>&#160;            var hit = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02778"></a><span class="lineno"> 2778</span>&#160;            <span class="keywordflow">if</span> (options.tolerance == <span class="stringliteral">&#39;touch&#39;</span>) {</div>
<div class="line"><a name="l02779"></a><span class="lineno"> 2779</span>&#160;                hit = ( !(selectee.left &gt; x2 || selectee.right &lt; x1 || selectee.top &gt; y2 || selectee.bottom &lt; y1) );</div>
<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (options.tolerance == <span class="stringliteral">&#39;fit&#39;</span>) {</div>
<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span>&#160;                hit = (selectee.left &gt; x1 &amp;&amp; selectee.right &lt; x2 &amp;&amp; selectee.top &gt; y1 &amp;&amp; selectee.bottom &lt; y2);</div>
<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>&#160;            }</div>
<div class="line"><a name="l02783"></a><span class="lineno"> 2783</span>&#160;</div>
<div class="line"><a name="l02784"></a><span class="lineno"> 2784</span>&#160;            <span class="keywordflow">if</span> (hit) {</div>
<div class="line"><a name="l02785"></a><span class="lineno"> 2785</span>&#160;                <span class="comment">// SELECT</span></div>
<div class="line"><a name="l02786"></a><span class="lineno"> 2786</span>&#160;                <span class="keywordflow">if</span> (selectee.selected) {</div>
<div class="line"><a name="l02787"></a><span class="lineno"> 2787</span>&#160;                    selectee.$element.removeClass(<span class="stringliteral">&#39;ui-selected&#39;</span>);</div>
<div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>&#160;                    selectee.selected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02789"></a><span class="lineno"> 2789</span>&#160;                }</div>
<div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>&#160;                <span class="keywordflow">if</span> (selectee.unselecting) {</div>
<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span>&#160;                    selectee.$element.removeClass(<span class="stringliteral">&#39;ui-unselecting&#39;</span>);</div>
<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>&#160;                    selectee.unselecting = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span>&#160;                }</div>
<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span>&#160;                <span class="keywordflow">if</span> (!selectee.selecting) {</div>
<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>&#160;                    selectee.$element.addClass(<span class="stringliteral">&#39;ui-selecting&#39;</span>);</div>
<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>&#160;                    selectee.selecting = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>&#160;                    <span class="comment">// selectable SELECTING callback</span></div>
<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>&#160;                    <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;selecting&quot;</span>, event, {</div>
<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>&#160;                        selecting: selectee.element</div>
<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span>&#160;                    });</div>
<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span>&#160;                }</div>
<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span>&#160;                <span class="comment">// UNSELECT</span></div>
<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span>&#160;                <span class="keywordflow">if</span> (selectee.selecting) {</div>
<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span>&#160;                    <span class="keywordflow">if</span> ((event.metaKey || event.ctrlKey) &amp;&amp; selectee.startselected) {</div>
<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span>&#160;                        selectee.$element.removeClass(<span class="stringliteral">&#39;ui-selecting&#39;</span>);</div>
<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span>&#160;                        selectee.selecting = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>&#160;                        selectee.$element.addClass(<span class="stringliteral">&#39;ui-selected&#39;</span>);</div>
<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>&#160;                        selectee.selected = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>&#160;                        selectee.$element.removeClass(<span class="stringliteral">&#39;ui-selecting&#39;</span>);</div>
<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>&#160;                        selectee.selecting = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span>&#160;                        <span class="keywordflow">if</span> (selectee.startselected) {</div>
<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span>&#160;                            selectee.$element.addClass(<span class="stringliteral">&#39;ui-unselecting&#39;</span>);</div>
<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>&#160;                            selectee.unselecting = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>&#160;                        }</div>
<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>&#160;                        <span class="comment">// selectable UNSELECTING callback</span></div>
<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>&#160;                        <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;unselecting&quot;</span>, event, {</div>
<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>&#160;                            unselecting: selectee.element</div>
<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>&#160;                        });</div>
<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>&#160;                    }</div>
<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>&#160;                }</div>
<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>&#160;                <span class="keywordflow">if</span> (selectee.selected) {</div>
<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>&#160;                    <span class="keywordflow">if</span> (!event.metaKey &amp;&amp; !event.ctrlKey &amp;&amp; !selectee.startselected) {</div>
<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>&#160;                        selectee.$element.removeClass(<span class="stringliteral">&#39;ui-selected&#39;</span>);</div>
<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span>&#160;                        selectee.selected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02827"></a><span class="lineno"> 2827</span>&#160;</div>
<div class="line"><a name="l02828"></a><span class="lineno"> 2828</span>&#160;                        selectee.$element.addClass(<span class="stringliteral">&#39;ui-unselecting&#39;</span>);</div>
<div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>&#160;                        selectee.unselecting = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02830"></a><span class="lineno"> 2830</span>&#160;                        <span class="comment">// selectable UNSELECTING callback</span></div>
<div class="line"><a name="l02831"></a><span class="lineno"> 2831</span>&#160;                        <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;unselecting&quot;</span>, event, {</div>
<div class="line"><a name="l02832"></a><span class="lineno"> 2832</span>&#160;                            unselecting: selectee.element</div>
<div class="line"><a name="l02833"></a><span class="lineno"> 2833</span>&#160;                        });</div>
<div class="line"><a name="l02834"></a><span class="lineno"> 2834</span>&#160;                    }</div>
<div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>&#160;                }</div>
<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>&#160;            }</div>
<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>&#160;        });</div>
<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>&#160;</div>
<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>&#160;    },</div>
<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span>&#160;</div>
<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>&#160;    _mouseStop: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>&#160;</div>
<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>&#160;        this.dragged = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>&#160;</div>
<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>&#160;</div>
<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>&#160;        $(<span class="stringliteral">&#39;.ui-unselecting&#39;</span>, this.element[0]).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>&#160;            var selectee = $.data(<span class="keyword">this</span>, <span class="stringliteral">&quot;selectable-item&quot;</span>);</div>
<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>&#160;            selectee.$element.removeClass(<span class="stringliteral">&#39;ui-unselecting&#39;</span>);</div>
<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>&#160;            selectee.unselecting = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>&#160;            selectee.startselected = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>&#160;            <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;unselected&quot;</span>, event, {</div>
<div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>&#160;                unselected: selectee.element</div>
<div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>&#160;            });</div>
<div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>&#160;        });</div>
<div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>&#160;        $(<span class="stringliteral">&#39;.ui-selecting&#39;</span>, this.element[0]).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>&#160;            var selectee = $.data(<span class="keyword">this</span>, <span class="stringliteral">&quot;selectable-item&quot;</span>);</div>
<div class="line"><a name="l02860"></a><span class="lineno"> 2860</span>&#160;            selectee.$element.removeClass(<span class="stringliteral">&#39;ui-selecting&#39;</span>).addClass(<span class="stringliteral">&#39;ui-selected&#39;</span>);</div>
<div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>&#160;            selectee.selecting = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>&#160;            selectee.selected = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>&#160;            selectee.startselected = <span class="keyword">true</span>;</div>
<div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>&#160;            <span class="keyword">self</span>._trigger(<span class="stringliteral">&quot;selected&quot;</span>, event, {</div>
<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>&#160;                selected: selectee.element</div>
<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>&#160;            });</div>
<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>&#160;        });</div>
<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>&#160;        this._trigger(<span class="stringliteral">&quot;stop&quot;</span>, event);</div>
<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>&#160;</div>
<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>&#160;        this.helper.remove();</div>
<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>&#160;</div>
<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>&#160;    }</div>
<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>&#160;</div>
<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>&#160;});</div>
<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>&#160;</div>
<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>&#160;$.extend($.ui.selectable, {</div>
<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>&#160;});</div>
<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>&#160;</div>
<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>&#160;})(jQuery);</div>
<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span>&#160;</div>
<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>&#160;</div>
<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>&#160;$.widget(<span class="stringliteral">&quot;ui.sortable&quot;</span>, $.ui.mouse, {</div>
<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>&#160;    widgetEventPrefix: <span class="stringliteral">&quot;sort&quot;</span>,</div>
<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>&#160;    ready: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>&#160;    options: {</div>
<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>&#160;        appendTo: <span class="stringliteral">&quot;parent&quot;</span>,</div>
<div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>&#160;        axis: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>&#160;        connectWith: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>&#160;        containment: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02893"></a><span class="lineno"> 2893</span>&#160;        cursor: <span class="stringliteral">&#39;auto&#39;</span>,</div>
<div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>&#160;        cursorAt: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>&#160;        dropOnEmpty: <span class="keyword">true</span>,</div>
<div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>&#160;        forcePlaceholderSize: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02897"></a><span class="lineno"> 2897</span>&#160;        forceHelperSize: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02898"></a><span class="lineno"> 2898</span>&#160;        grid: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>&#160;        handle: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>&#160;        helper: <span class="stringliteral">&quot;original&quot;</span>,</div>
<div class="line"><a name="l02901"></a><span class="lineno"> 2901</span>&#160;        items: <span class="stringliteral">&#39;&gt; *&#39;</span>,</div>
<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>&#160;        opacity: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>&#160;        placeholder: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>&#160;        revert: <span class="keyword">false</span>,</div>
<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>&#160;        scroll: <span class="keyword">true</span>,</div>
<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>&#160;        scrollSensitivity: 20,</div>
<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>&#160;        scrollSpeed: 20,</div>
<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>&#160;        scope: <span class="stringliteral">&quot;default&quot;</span>,</div>
<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>&#160;        tolerance: <span class="stringliteral">&quot;intersect&quot;</span>,</div>
<div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>&#160;        zIndex: 1000</div>
<div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>&#160;    },</div>
<div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>&#160;</div>
<div class="line"><a name="l02914"></a><span class="lineno"> 2914</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l02915"></a><span class="lineno"> 2915</span>&#160;        this.containerCache = {};</div>
<div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>&#160;        this.element.addClass(<span class="stringliteral">&quot;ui-sortable&quot;</span>);</div>
<div class="line"><a name="l02917"></a><span class="lineno"> 2917</span>&#160;</div>
<div class="line"><a name="l02918"></a><span class="lineno"> 2918</span>&#160;        <span class="comment">//Get the items</span></div>
<div class="line"><a name="l02919"></a><span class="lineno"> 2919</span>&#160;        this.refresh();</div>
<div class="line"><a name="l02920"></a><span class="lineno"> 2920</span>&#160;</div>
<div class="line"><a name="l02921"></a><span class="lineno"> 2921</span>&#160;        <span class="comment">//Let&#39;s determine if the items are being displayed horizontally</span></div>
<div class="line"><a name="l02922"></a><span class="lineno"> 2922</span>&#160;        this.floating = this.items.length ? o.axis === <span class="charliteral">&#39;x&#39;</span> || (/left|right/).test(this.items[0].item.css(<span class="stringliteral">&#39;float&#39;</span>)) || (/<span class="keyword">inline</span>|table-cell/).test(this.items[0].item.css(<span class="stringliteral">&#39;display&#39;</span>)) : <span class="keyword">false</span>;</div>
<div class="line"><a name="l02923"></a><span class="lineno"> 2923</span>&#160;</div>
<div class="line"><a name="l02924"></a><span class="lineno"> 2924</span>&#160;        <span class="comment">//Let&#39;s determine the parent&#39;s offset</span></div>
<div class="line"><a name="l02925"></a><span class="lineno"> 2925</span>&#160;        this.offset = this.element.offset();</div>
<div class="line"><a name="l02926"></a><span class="lineno"> 2926</span>&#160;</div>
<div class="line"><a name="l02927"></a><span class="lineno"> 2927</span>&#160;        <span class="comment">//Initialize mouse events for interaction</span></div>
<div class="line"><a name="l02928"></a><span class="lineno"> 2928</span>&#160;        this._mouseInit();</div>
<div class="line"><a name="l02929"></a><span class="lineno"> 2929</span>&#160;        </div>
<div class="line"><a name="l02930"></a><span class="lineno"> 2930</span>&#160;        <span class="comment">//We&#39;re ready to go</span></div>
<div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>&#160;        this.ready = <span class="keyword">true</span></div>
<div class="line"><a name="l02932"></a><span class="lineno"> 2932</span>&#160;</div>
<div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>&#160;    },</div>
<div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>&#160;</div>
<div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>&#160;        $.Widget.prototype.destroy.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>&#160;        this.element</div>
<div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>&#160;            .removeClass(<span class="stringliteral">&quot;ui-sortable ui-sortable-disabled&quot;</span>);</div>
<div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>&#160;        this._mouseDestroy();</div>
<div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>&#160;</div>
<div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>&#160;        <span class="keywordflow">for</span> ( var i = this.items.length - 1; i &gt;= 0; i-- )</div>
<div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>&#160;            this.items[i].item.removeData(this.widgetName + <span class="stringliteral">&quot;-item&quot;</span>);</div>
<div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>&#160;</div>
<div class="line"><a name="l02944"></a><span class="lineno"> 2944</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>&#160;    },</div>
<div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>&#160;</div>
<div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>&#160;    _setOption: <span class="keyword">function</span>(key, value){</div>
<div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;disabled&quot;</span> ) {</div>
<div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>&#160;            this.options[ key ] = value;</div>
<div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>&#160;    </div>
<div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>&#160;            this.widget()</div>
<div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>&#160;                [ value ? <span class="stringliteral">&quot;addClass&quot;</span> : <span class="stringliteral">&quot;removeClass&quot;</span>]( <span class="stringliteral">&quot;ui-sortable-disabled&quot;</span> );</div>
<div class="line"><a name="l02953"></a><span class="lineno"> 2953</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02954"></a><span class="lineno"> 2954</span>&#160;            <span class="comment">// Don&#39;t call widget base _setOption for disable as it adds ui-state-disabled class</span></div>
<div class="line"><a name="l02955"></a><span class="lineno"> 2955</span>&#160;            $.Widget.prototype._setOption.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l02956"></a><span class="lineno"> 2956</span>&#160;        }</div>
<div class="line"><a name="l02957"></a><span class="lineno"> 2957</span>&#160;    },</div>
<div class="line"><a name="l02958"></a><span class="lineno"> 2958</span>&#160;</div>
<div class="line"><a name="l02959"></a><span class="lineno"> 2959</span>&#160;    _mouseCapture: <span class="keyword">function</span>(event, overrideHandle) {</div>
<div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>&#160;        var that = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02961"></a><span class="lineno"> 2961</span>&#160;</div>
<div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>&#160;        <span class="keywordflow">if</span> (this.reverting) {</div>
<div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>&#160;        }</div>
<div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>&#160;</div>
<div class="line"><a name="l02966"></a><span class="lineno"> 2966</span>&#160;        <span class="keywordflow">if</span>(this.options.disabled || <span class="keyword">this</span>.options.type == <span class="stringliteral">&#39;static&#39;</span>) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>&#160;</div>
<div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>&#160;        <span class="comment">//We have to refresh the items data once first</span></div>
<div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>&#160;        this._refreshItems(event);</div>
<div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>&#160;</div>
<div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>&#160;        <span class="comment">//Find out if the clicked node (or one of its parents) is a actual item in this.items</span></div>
<div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>&#160;        var currentItem = null, <span class="keyword">self</span> = <span class="keyword">this</span>, nodes = $(<span class="keyword">event</span>.target).parents().each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>&#160;            <span class="keywordflow">if</span>($.data(<span class="keyword">this</span>, that.widgetName + <span class="stringliteral">&#39;-item&#39;</span>) == <span class="keyword">self</span>) {</div>
<div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>&#160;                currentItem = $(<span class="keyword">this</span>);</div>
<div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02976"></a><span class="lineno"> 2976</span>&#160;            }</div>
<div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>&#160;        });</div>
<div class="line"><a name="l02978"></a><span class="lineno"> 2978</span>&#160;        <span class="keywordflow">if</span>($.data(event.target, that.widgetName + <span class="stringliteral">&#39;-item&#39;</span>) == <span class="keyword">self</span>) currentItem = $(<span class="keyword">event</span>.target);</div>
<div class="line"><a name="l02979"></a><span class="lineno"> 2979</span>&#160;</div>
<div class="line"><a name="l02980"></a><span class="lineno"> 2980</span>&#160;        <span class="keywordflow">if</span>(!currentItem) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>&#160;        <span class="keywordflow">if</span>(this.options.handle &amp;&amp; !overrideHandle) {</div>
<div class="line"><a name="l02982"></a><span class="lineno"> 2982</span>&#160;            var validHandle = <span class="keyword">false</span>;</div>
<div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>&#160;</div>
<div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>&#160;            $(this.options.handle, currentItem).find(<span class="stringliteral">&quot;*&quot;</span>).andSelf().each(<span class="keyword">function</span>() { <span class="keywordflow">if</span>(<span class="keyword">this</span> == event.target) validHandle = <span class="keyword">true</span>; });</div>
<div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>&#160;            <span class="keywordflow">if</span>(!validHandle) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>&#160;        }</div>
<div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>&#160;</div>
<div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>&#160;        this.currentItem = currentItem;</div>
<div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>&#160;        this._removeCurrentsFromItems();</div>
<div class="line"><a name="l02990"></a><span class="lineno"> 2990</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l02991"></a><span class="lineno"> 2991</span>&#160;</div>
<div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>&#160;    },</div>
<div class="line"><a name="l02993"></a><span class="lineno"> 2993</span>&#160;</div>
<div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>&#160;    _mouseStart: <span class="keyword">function</span>(event, overrideHandle, noActivation) {</div>
<div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>&#160;</div>
<div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>&#160;        var o = this.options, <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>&#160;        this.currentContainer = <span class="keyword">this</span>;</div>
<div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>&#160;</div>
<div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>&#160;        <span class="comment">//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture</span></div>
<div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>&#160;        this.refreshPositions();</div>
<div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>&#160;</div>
<div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>&#160;        <span class="comment">//Create and append the visible helper</span></div>
<div class="line"><a name="l03003"></a><span class="lineno"> 3003</span>&#160;        this.helper = this._createHelper(event);</div>
<div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>&#160;</div>
<div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>&#160;        <span class="comment">//Cache the helper size</span></div>
<div class="line"><a name="l03006"></a><span class="lineno"> 3006</span>&#160;        this._cacheHelperProportions();</div>
<div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>&#160;</div>
<div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>&#160;<span class="comment">         * - Position generation -</span></div>
<div class="line"><a name="l03010"></a><span class="lineno"> 3010</span>&#160;<span class="comment">         * This block generates everything position related - it&#39;s the core of draggables.</span></div>
<div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03012"></a><span class="lineno"> 3012</span>&#160;</div>
<div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>&#160;        <span class="comment">//Cache the margins of the original element</span></div>
<div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>&#160;        this._cacheMargins();</div>
<div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>&#160;</div>
<div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>&#160;        <span class="comment">//Get the next scrolling parent</span></div>
<div class="line"><a name="l03017"></a><span class="lineno"> 3017</span>&#160;        this.scrollParent = this.helper.scrollParent();</div>
<div class="line"><a name="l03018"></a><span class="lineno"> 3018</span>&#160;</div>
<div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>&#160;        <span class="comment">//The element&#39;s absolute position on the page minus margins</span></div>
<div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>&#160;        this.offset = this.currentItem.offset();</div>
<div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>&#160;        this.offset = {</div>
<div class="line"><a name="l03022"></a><span class="lineno"> 3022</span>&#160;            top: this.offset.top - this.margins.top,</div>
<div class="line"><a name="l03023"></a><span class="lineno"> 3023</span>&#160;            left: this.offset.left - this.margins.left</div>
<div class="line"><a name="l03024"></a><span class="lineno"> 3024</span>&#160;        };</div>
<div class="line"><a name="l03025"></a><span class="lineno"> 3025</span>&#160;</div>
<div class="line"><a name="l03026"></a><span class="lineno"> 3026</span>&#160;        <span class="comment">// Only after we got the offset, we can change the helper&#39;s position to absolute</span></div>
<div class="line"><a name="l03027"></a><span class="lineno"> 3027</span>&#160;        <span class="comment">// TODO: Still need to figure out a way to make relative sorting possible</span></div>
<div class="line"><a name="l03028"></a><span class="lineno"> 3028</span>&#160;        this.helper.css(<span class="stringliteral">&quot;position&quot;</span>, <span class="stringliteral">&quot;absolute&quot;</span>);</div>
<div class="line"><a name="l03029"></a><span class="lineno"> 3029</span>&#160;        this.cssPosition = this.helper.css(<span class="stringliteral">&quot;position&quot;</span>);</div>
<div class="line"><a name="l03030"></a><span class="lineno"> 3030</span>&#160;</div>
<div class="line"><a name="l03031"></a><span class="lineno"> 3031</span>&#160;        $.extend(this.offset, {</div>
<div class="line"><a name="l03032"></a><span class="lineno"> 3032</span>&#160;            click: { <span class="comment">//Where the click happened, relative to the element</span></div>
<div class="line"><a name="l03033"></a><span class="lineno"> 3033</span>&#160;                left: <span class="keyword">event</span>.pageX - this.offset.left,</div>
<div class="line"><a name="l03034"></a><span class="lineno"> 3034</span>&#160;                top: <span class="keyword">event</span>.pageY - this.offset.top</div>
<div class="line"><a name="l03035"></a><span class="lineno"> 3035</span>&#160;            },</div>
<div class="line"><a name="l03036"></a><span class="lineno"> 3036</span>&#160;            parent: this._getParentOffset(),</div>
<div class="line"><a name="l03037"></a><span class="lineno"> 3037</span>&#160;            relative: this._getRelativeOffset() <span class="comment">//This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper</span></div>
<div class="line"><a name="l03038"></a><span class="lineno"> 3038</span>&#160;        });</div>
<div class="line"><a name="l03039"></a><span class="lineno"> 3039</span>&#160;</div>
<div class="line"><a name="l03040"></a><span class="lineno"> 3040</span>&#160;        <span class="comment">//Generate the original position</span></div>
<div class="line"><a name="l03041"></a><span class="lineno"> 3041</span>&#160;        this.originalPosition = this._generatePosition(event);</div>
<div class="line"><a name="l03042"></a><span class="lineno"> 3042</span>&#160;        this.originalPageX = <span class="keyword">event</span>.pageX;</div>
<div class="line"><a name="l03043"></a><span class="lineno"> 3043</span>&#160;        this.originalPageY = <span class="keyword">event</span>.pageY;</div>
<div class="line"><a name="l03044"></a><span class="lineno"> 3044</span>&#160;</div>
<div class="line"><a name="l03045"></a><span class="lineno"> 3045</span>&#160;        <span class="comment">//Adjust the mouse offset relative to the helper if &#39;cursorAt&#39; is supplied</span></div>
<div class="line"><a name="l03046"></a><span class="lineno"> 3046</span>&#160;        (o.cursorAt &amp;&amp; this._adjustOffsetFromHelper(o.cursorAt));</div>
<div class="line"><a name="l03047"></a><span class="lineno"> 3047</span>&#160;</div>
<div class="line"><a name="l03048"></a><span class="lineno"> 3048</span>&#160;        <span class="comment">//Cache the former DOM position</span></div>
<div class="line"><a name="l03049"></a><span class="lineno"> 3049</span>&#160;        this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };</div>
<div class="line"><a name="l03050"></a><span class="lineno"> 3050</span>&#160;</div>
<div class="line"><a name="l03051"></a><span class="lineno"> 3051</span>&#160;        <span class="comment">//If the helper is not the original, hide the original so it&#39;s not playing any role during the drag, won&#39;t cause anything bad this way</span></div>
<div class="line"><a name="l03052"></a><span class="lineno"> 3052</span>&#160;        <span class="keywordflow">if</span>(this.helper[0] != this.currentItem[0]) {</div>
<div class="line"><a name="l03053"></a><span class="lineno"> 3053</span>&#160;            this.currentItem.hide();</div>
<div class="line"><a name="l03054"></a><span class="lineno"> 3054</span>&#160;        }</div>
<div class="line"><a name="l03055"></a><span class="lineno"> 3055</span>&#160;</div>
<div class="line"><a name="l03056"></a><span class="lineno"> 3056</span>&#160;        <span class="comment">//Create the placeholder</span></div>
<div class="line"><a name="l03057"></a><span class="lineno"> 3057</span>&#160;        this._createPlaceholder();</div>
<div class="line"><a name="l03058"></a><span class="lineno"> 3058</span>&#160;</div>
<div class="line"><a name="l03059"></a><span class="lineno"> 3059</span>&#160;        <span class="comment">//Set a containment if given in the options</span></div>
<div class="line"><a name="l03060"></a><span class="lineno"> 3060</span>&#160;        <span class="keywordflow">if</span>(o.containment)</div>
<div class="line"><a name="l03061"></a><span class="lineno"> 3061</span>&#160;            this._setContainment();</div>
<div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>&#160;</div>
<div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>&#160;        <span class="keywordflow">if</span>(o.cursor) { <span class="comment">// cursor option</span></div>
<div class="line"><a name="l03064"></a><span class="lineno"> 3064</span>&#160;            <span class="keywordflow">if</span> ($(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&quot;cursor&quot;</span>)) this._storedCursor = $(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&quot;cursor&quot;</span>);</div>
<div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>&#160;            $(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&quot;cursor&quot;</span>, o.cursor);</div>
<div class="line"><a name="l03066"></a><span class="lineno"> 3066</span>&#160;        }</div>
<div class="line"><a name="l03067"></a><span class="lineno"> 3067</span>&#160;</div>
<div class="line"><a name="l03068"></a><span class="lineno"> 3068</span>&#160;        <span class="keywordflow">if</span>(o.opacity) { <span class="comment">// opacity option</span></div>
<div class="line"><a name="l03069"></a><span class="lineno"> 3069</span>&#160;            <span class="keywordflow">if</span> (this.helper.css(<span class="stringliteral">&quot;opacity&quot;</span>)) this._storedOpacity = this.helper.css(<span class="stringliteral">&quot;opacity&quot;</span>);</div>
<div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>&#160;            this.helper.css(<span class="stringliteral">&quot;opacity&quot;</span>, o.opacity);</div>
<div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>&#160;        }</div>
<div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>&#160;</div>
<div class="line"><a name="l03073"></a><span class="lineno"> 3073</span>&#160;        <span class="keywordflow">if</span>(o.zIndex) { <span class="comment">// zIndex option</span></div>
<div class="line"><a name="l03074"></a><span class="lineno"> 3074</span>&#160;            <span class="keywordflow">if</span> (this.helper.css(<span class="stringliteral">&quot;zIndex&quot;</span>)) this._storedZIndex = this.helper.css(<span class="stringliteral">&quot;zIndex&quot;</span>);</div>
<div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>&#160;            this.helper.css(<span class="stringliteral">&quot;zIndex&quot;</span>, o.zIndex);</div>
<div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>&#160;        }</div>
<div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>&#160;</div>
<div class="line"><a name="l03078"></a><span class="lineno"> 3078</span>&#160;        <span class="comment">//Prepare scrolling</span></div>
<div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>&#160;        <span class="keywordflow">if</span>(this.scrollParent[0] != document &amp;&amp; this.scrollParent[0].tagName != <span class="stringliteral">&#39;HTML&#39;</span>)</div>
<div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>&#160;            this.overflowOffset = this.scrollParent.offset();</div>
<div class="line"><a name="l03081"></a><span class="lineno"> 3081</span>&#160;</div>
<div class="line"><a name="l03082"></a><span class="lineno"> 3082</span>&#160;        <span class="comment">//Call callbacks</span></div>
<div class="line"><a name="l03083"></a><span class="lineno"> 3083</span>&#160;        this._trigger(<span class="stringliteral">&quot;start&quot;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03084"></a><span class="lineno"> 3084</span>&#160;</div>
<div class="line"><a name="l03085"></a><span class="lineno"> 3085</span>&#160;        <span class="comment">//Recache the helper size</span></div>
<div class="line"><a name="l03086"></a><span class="lineno"> 3086</span>&#160;        <span class="keywordflow">if</span>(!this._preserveHelperProportions)</div>
<div class="line"><a name="l03087"></a><span class="lineno"> 3087</span>&#160;            this._cacheHelperProportions();</div>
<div class="line"><a name="l03088"></a><span class="lineno"> 3088</span>&#160;</div>
<div class="line"><a name="l03089"></a><span class="lineno"> 3089</span>&#160;</div>
<div class="line"><a name="l03090"></a><span class="lineno"> 3090</span>&#160;        <span class="comment">//Post &#39;activate&#39; events to possible containers</span></div>
<div class="line"><a name="l03091"></a><span class="lineno"> 3091</span>&#160;        <span class="keywordflow">if</span>(!noActivation) {</div>
<div class="line"><a name="l03092"></a><span class="lineno"> 3092</span>&#160;             <span class="keywordflow">for</span> (var i = this.containers.length - 1; i &gt;= 0; i--) { this.containers[i]._trigger(<span class="stringliteral">&quot;activate&quot;</span>, event, <span class="keyword">self</span>._uiHash(<span class="keyword">this</span>)); }</div>
<div class="line"><a name="l03093"></a><span class="lineno"> 3093</span>&#160;        }</div>
<div class="line"><a name="l03094"></a><span class="lineno"> 3094</span>&#160;</div>
<div class="line"><a name="l03095"></a><span class="lineno"> 3095</span>&#160;        <span class="comment">//Prepare possible droppables</span></div>
<div class="line"><a name="l03096"></a><span class="lineno"> 3096</span>&#160;        <span class="keywordflow">if</span>($.ui.ddmanager)</div>
<div class="line"><a name="l03097"></a><span class="lineno"> 3097</span>&#160;            $.ui.ddmanager.current = <span class="keyword">this</span>;</div>
<div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>&#160;</div>
<div class="line"><a name="l03099"></a><span class="lineno"> 3099</span>&#160;        <span class="keywordflow">if</span> ($.ui.ddmanager &amp;&amp; !o.dropBehaviour)</div>
<div class="line"><a name="l03100"></a><span class="lineno"> 3100</span>&#160;            $.ui.ddmanager.prepareOffsets(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l03101"></a><span class="lineno"> 3101</span>&#160;</div>
<div class="line"><a name="l03102"></a><span class="lineno"> 3102</span>&#160;        this.dragging = <span class="keyword">true</span>;</div>
<div class="line"><a name="l03103"></a><span class="lineno"> 3103</span>&#160;</div>
<div class="line"><a name="l03104"></a><span class="lineno"> 3104</span>&#160;        this.helper.addClass(<span class="stringliteral">&quot;ui-sortable-helper&quot;</span>);</div>
<div class="line"><a name="l03105"></a><span class="lineno"> 3105</span>&#160;        this._mouseDrag(event); <span class="comment">//Execute the drag once - this causes the helper not to be visible before getting its correct position</span></div>
<div class="line"><a name="l03106"></a><span class="lineno"> 3106</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l03107"></a><span class="lineno"> 3107</span>&#160;</div>
<div class="line"><a name="l03108"></a><span class="lineno"> 3108</span>&#160;    },</div>
<div class="line"><a name="l03109"></a><span class="lineno"> 3109</span>&#160;</div>
<div class="line"><a name="l03110"></a><span class="lineno"> 3110</span>&#160;    _mouseDrag: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l03111"></a><span class="lineno"> 3111</span>&#160;</div>
<div class="line"><a name="l03112"></a><span class="lineno"> 3112</span>&#160;        <span class="comment">//Compute the helpers position</span></div>
<div class="line"><a name="l03113"></a><span class="lineno"> 3113</span>&#160;        this.position = this._generatePosition(event);</div>
<div class="line"><a name="l03114"></a><span class="lineno"> 3114</span>&#160;        this.positionAbs = this._convertPositionTo(<span class="stringliteral">&quot;absolute&quot;</span>);</div>
<div class="line"><a name="l03115"></a><span class="lineno"> 3115</span>&#160;</div>
<div class="line"><a name="l03116"></a><span class="lineno"> 3116</span>&#160;        <span class="keywordflow">if</span> (!this.lastPositionAbs) {</div>
<div class="line"><a name="l03117"></a><span class="lineno"> 3117</span>&#160;            this.lastPositionAbs = this.positionAbs;</div>
<div class="line"><a name="l03118"></a><span class="lineno"> 3118</span>&#160;        }</div>
<div class="line"><a name="l03119"></a><span class="lineno"> 3119</span>&#160;</div>
<div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>&#160;        <span class="comment">//Do scrolling</span></div>
<div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>&#160;        <span class="keywordflow">if</span>(this.options.scroll) {</div>
<div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>&#160;            var o = this.options, scrolled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l03123"></a><span class="lineno"> 3123</span>&#160;            <span class="keywordflow">if</span>(this.scrollParent[0] != document &amp;&amp; this.scrollParent[0].tagName != <span class="stringliteral">&#39;HTML&#39;</span>) {</div>
<div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>&#160;</div>
<div class="line"><a name="l03125"></a><span class="lineno"> 3125</span>&#160;                <span class="keywordflow">if</span>((this.overflowOffset.top + <span class="keyword">this</span>.scrollParent[0].offsetHeight) - event.pageY &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03126"></a><span class="lineno"> 3126</span>&#160;                    this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;</div>
<div class="line"><a name="l03127"></a><span class="lineno"> 3127</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>(event.pageY - <span class="keyword">this</span>.overflowOffset.top &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03128"></a><span class="lineno"> 3128</span>&#160;                    this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;</div>
<div class="line"><a name="l03129"></a><span class="lineno"> 3129</span>&#160;</div>
<div class="line"><a name="l03130"></a><span class="lineno"> 3130</span>&#160;                <span class="keywordflow">if</span>((this.overflowOffset.left + <span class="keyword">this</span>.scrollParent[0].offsetWidth) - event.pageX &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03131"></a><span class="lineno"> 3131</span>&#160;                    this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;</div>
<div class="line"><a name="l03132"></a><span class="lineno"> 3132</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>(event.pageX - <span class="keyword">this</span>.overflowOffset.left &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03133"></a><span class="lineno"> 3133</span>&#160;                    this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;</div>
<div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>&#160;</div>
<div class="line"><a name="l03135"></a><span class="lineno"> 3135</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03136"></a><span class="lineno"> 3136</span>&#160;</div>
<div class="line"><a name="l03137"></a><span class="lineno"> 3137</span>&#160;                <span class="keywordflow">if</span>(event.pageY - $(document).scrollTop() &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03138"></a><span class="lineno"> 3138</span>&#160;                    scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);</div>
<div class="line"><a name="l03139"></a><span class="lineno"> 3139</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>($(window).height() - (event.pageY - $(document).scrollTop()) &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>&#160;                    scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);</div>
<div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>&#160;</div>
<div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>&#160;                <span class="keywordflow">if</span>(event.pageX - $(document).scrollLeft() &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>&#160;                    scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);</div>
<div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span>($(window).width() - (event.pageX - $(document).scrollLeft()) &lt; o.scrollSensitivity)</div>
<div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>&#160;                    scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);</div>
<div class="line"><a name="l03146"></a><span class="lineno"> 3146</span>&#160;</div>
<div class="line"><a name="l03147"></a><span class="lineno"> 3147</span>&#160;            }</div>
<div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>&#160;</div>
<div class="line"><a name="l03149"></a><span class="lineno"> 3149</span>&#160;            <span class="keywordflow">if</span>(scrolled !== <span class="keyword">false</span> &amp;&amp; $.ui.ddmanager &amp;&amp; !o.dropBehaviour)</div>
<div class="line"><a name="l03150"></a><span class="lineno"> 3150</span>&#160;                $.ui.ddmanager.prepareOffsets(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l03151"></a><span class="lineno"> 3151</span>&#160;        }</div>
<div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>&#160;</div>
<div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>&#160;        <span class="comment">//Regenerate the absolute position used for position checks</span></div>
<div class="line"><a name="l03154"></a><span class="lineno"> 3154</span>&#160;        this.positionAbs = this._convertPositionTo(<span class="stringliteral">&quot;absolute&quot;</span>);</div>
<div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>&#160;</div>
<div class="line"><a name="l03156"></a><span class="lineno"> 3156</span>&#160;        <span class="comment">//Set the helper position</span></div>
<div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>&#160;        <span class="keywordflow">if</span>(!this.options.axis || <span class="keyword">this</span>.options.axis != <span class="stringliteral">&quot;y&quot;</span>) this.helper[0].style.left = this.position.left+<span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l03158"></a><span class="lineno"> 3158</span>&#160;        <span class="keywordflow">if</span>(!this.options.axis || <span class="keyword">this</span>.options.axis != <span class="stringliteral">&quot;x&quot;</span>) this.helper[0].style.top = this.position.top+<span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l03159"></a><span class="lineno"> 3159</span>&#160;</div>
<div class="line"><a name="l03160"></a><span class="lineno"> 3160</span>&#160;        <span class="comment">//Rearrange</span></div>
<div class="line"><a name="l03161"></a><span class="lineno"> 3161</span>&#160;        <span class="keywordflow">for</span> (var i = this.items.length - 1; i &gt;= 0; i--) {</div>
<div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>&#160;</div>
<div class="line"><a name="l03163"></a><span class="lineno"> 3163</span>&#160;            <span class="comment">//Cache variables and intersection, continue if no intersection</span></div>
<div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>&#160;            var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);</div>
<div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>&#160;            <span class="keywordflow">if</span> (!intersection) <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>&#160;</div>
<div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>&#160;            <span class="keywordflow">if</span>(itemElement != this.currentItem[0] <span class="comment">//cannot intersect with itself</span></div>
<div class="line"><a name="l03168"></a><span class="lineno"> 3168</span>&#160;                &amp;&amp;  this.placeholder[intersection == 1 ? <span class="stringliteral">&quot;next&quot;</span> : <span class="stringliteral">&quot;prev&quot;</span>]()[0] != itemElement <span class="comment">//no useless actions that have been done before</span></div>
<div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>&#160;                &amp;&amp;  !$.ui.contains(<span class="keyword">this</span>.placeholder[0], itemElement) <span class="comment">//no action if the item moved is the parent of the item checked</span></div>
<div class="line"><a name="l03170"></a><span class="lineno"> 3170</span>&#160;                &amp;&amp; (this.options.type == <span class="stringliteral">&#39;semi-dynamic&#39;</span> ? !$.ui.contains(this.element[0], itemElement) : <span class="keyword">true</span>)</div>
<div class="line"><a name="l03171"></a><span class="lineno"> 3171</span>&#160;                <span class="comment">//&amp;&amp; itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container</span></div>
<div class="line"><a name="l03172"></a><span class="lineno"> 3172</span>&#160;            ) {</div>
<div class="line"><a name="l03173"></a><span class="lineno"> 3173</span>&#160;</div>
<div class="line"><a name="l03174"></a><span class="lineno"> 3174</span>&#160;                this.direction = intersection == 1 ? <span class="stringliteral">&quot;down&quot;</span> : <span class="stringliteral">&quot;up&quot;</span>;</div>
<div class="line"><a name="l03175"></a><span class="lineno"> 3175</span>&#160;</div>
<div class="line"><a name="l03176"></a><span class="lineno"> 3176</span>&#160;                <span class="keywordflow">if</span> (this.options.tolerance == <span class="stringliteral">&quot;pointer&quot;</span> || <span class="keyword">this</span>._intersectsWithSides(item)) {</div>
<div class="line"><a name="l03177"></a><span class="lineno"> 3177</span>&#160;                    this._rearrange(event, item);</div>
<div class="line"><a name="l03178"></a><span class="lineno"> 3178</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03179"></a><span class="lineno"> 3179</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03180"></a><span class="lineno"> 3180</span>&#160;                }</div>
<div class="line"><a name="l03181"></a><span class="lineno"> 3181</span>&#160;</div>
<div class="line"><a name="l03182"></a><span class="lineno"> 3182</span>&#160;                this._trigger(<span class="stringliteral">&quot;change&quot;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03183"></a><span class="lineno"> 3183</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03184"></a><span class="lineno"> 3184</span>&#160;            }</div>
<div class="line"><a name="l03185"></a><span class="lineno"> 3185</span>&#160;        }</div>
<div class="line"><a name="l03186"></a><span class="lineno"> 3186</span>&#160;</div>
<div class="line"><a name="l03187"></a><span class="lineno"> 3187</span>&#160;        <span class="comment">//Post events to containers</span></div>
<div class="line"><a name="l03188"></a><span class="lineno"> 3188</span>&#160;        this._contactContainers(event);</div>
<div class="line"><a name="l03189"></a><span class="lineno"> 3189</span>&#160;</div>
<div class="line"><a name="l03190"></a><span class="lineno"> 3190</span>&#160;        <span class="comment">//Interconnect with droppables</span></div>
<div class="line"><a name="l03191"></a><span class="lineno"> 3191</span>&#160;        <span class="keywordflow">if</span>($.ui.ddmanager) $.ui.ddmanager.drag(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l03192"></a><span class="lineno"> 3192</span>&#160;</div>
<div class="line"><a name="l03193"></a><span class="lineno"> 3193</span>&#160;        <span class="comment">//Call callbacks</span></div>
<div class="line"><a name="l03194"></a><span class="lineno"> 3194</span>&#160;        this._trigger(<span class="stringliteral">&#39;sort&#39;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03195"></a><span class="lineno"> 3195</span>&#160;</div>
<div class="line"><a name="l03196"></a><span class="lineno"> 3196</span>&#160;        this.lastPositionAbs = this.positionAbs;</div>
<div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l03198"></a><span class="lineno"> 3198</span>&#160;</div>
<div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>&#160;    },</div>
<div class="line"><a name="l03200"></a><span class="lineno"> 3200</span>&#160;</div>
<div class="line"><a name="l03201"></a><span class="lineno"> 3201</span>&#160;    _mouseStop: <span class="keyword">function</span>(event, noPropagation) {</div>
<div class="line"><a name="l03202"></a><span class="lineno"> 3202</span>&#160;</div>
<div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>&#160;        <span class="keywordflow">if</span>(!event) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>&#160;</div>
<div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>&#160;        <span class="comment">//If we are using droppables, inform the manager about the drop</span></div>
<div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>&#160;        <span class="keywordflow">if</span> ($.ui.ddmanager &amp;&amp; !<span class="keyword">this</span>.options.dropBehaviour)</div>
<div class="line"><a name="l03207"></a><span class="lineno"> 3207</span>&#160;            $.ui.ddmanager.drop(<span class="keyword">this</span>, event);</div>
<div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>&#160;</div>
<div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>&#160;        <span class="keywordflow">if</span>(this.options.revert) {</div>
<div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>&#160;            var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>&#160;            var cur = <span class="keyword">self</span>.placeholder.offset();</div>
<div class="line"><a name="l03212"></a><span class="lineno"> 3212</span>&#160;</div>
<div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>&#160;            <span class="keyword">self</span>.reverting = <span class="keyword">true</span>;</div>
<div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>&#160;</div>
<div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>&#160;            $(this.helper).animate({</div>
<div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>&#160;                left: cur.left - this.offset.parent.left - <span class="keyword">self</span>.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),</div>
<div class="line"><a name="l03217"></a><span class="lineno"> 3217</span>&#160;                top: cur.top - <span class="keyword">this</span>.offset.parent.top - <span class="keyword">self</span>.margins.top + (<span class="keyword">this</span>.offsetParent[0] == document.body ? 0 : <span class="keyword">this</span>.offsetParent[0].scrollTop)</div>
<div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>&#160;            }, parseInt(this.options.revert, 10) || 500, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03219"></a><span class="lineno"> 3219</span>&#160;                <span class="keyword">self</span>._clear(event);</div>
<div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>&#160;            });</div>
<div class="line"><a name="l03221"></a><span class="lineno"> 3221</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03222"></a><span class="lineno"> 3222</span>&#160;            this._clear(event, noPropagation);</div>
<div class="line"><a name="l03223"></a><span class="lineno"> 3223</span>&#160;        }</div>
<div class="line"><a name="l03224"></a><span class="lineno"> 3224</span>&#160;</div>
<div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l03226"></a><span class="lineno"> 3226</span>&#160;</div>
<div class="line"><a name="l03227"></a><span class="lineno"> 3227</span>&#160;    },</div>
<div class="line"><a name="l03228"></a><span class="lineno"> 3228</span>&#160;</div>
<div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>&#160;    cancel: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03230"></a><span class="lineno"> 3230</span>&#160;</div>
<div class="line"><a name="l03231"></a><span class="lineno"> 3231</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>&#160;</div>
<div class="line"><a name="l03233"></a><span class="lineno"> 3233</span>&#160;        <span class="keywordflow">if</span>(this.dragging) {</div>
<div class="line"><a name="l03234"></a><span class="lineno"> 3234</span>&#160;</div>
<div class="line"><a name="l03235"></a><span class="lineno"> 3235</span>&#160;            this._mouseUp({ target: null });</div>
<div class="line"><a name="l03236"></a><span class="lineno"> 3236</span>&#160;</div>
<div class="line"><a name="l03237"></a><span class="lineno"> 3237</span>&#160;            <span class="keywordflow">if</span>(this.options.helper == <span class="stringliteral">&quot;original&quot;</span>)</div>
<div class="line"><a name="l03238"></a><span class="lineno"> 3238</span>&#160;                this.currentItem.css(this._storedCSS).removeClass(<span class="stringliteral">&quot;ui-sortable-helper&quot;</span>);</div>
<div class="line"><a name="l03239"></a><span class="lineno"> 3239</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l03240"></a><span class="lineno"> 3240</span>&#160;                this.currentItem.show();</div>
<div class="line"><a name="l03241"></a><span class="lineno"> 3241</span>&#160;</div>
<div class="line"><a name="l03242"></a><span class="lineno"> 3242</span>&#160;            <span class="comment">//Post deactivating events to containers</span></div>
<div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>&#160;            <span class="keywordflow">for</span> (var i = this.containers.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>&#160;                this.containers[i]._trigger(<span class="stringliteral">&quot;deactivate&quot;</span>, null, <span class="keyword">self</span>._uiHash(<span class="keyword">this</span>));</div>
<div class="line"><a name="l03245"></a><span class="lineno"> 3245</span>&#160;                <span class="keywordflow">if</span>(this.containers[i].containerCache.over) {</div>
<div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>&#160;                    this.containers[i]._trigger(<span class="stringliteral">&quot;out&quot;</span>, null, <span class="keyword">self</span>._uiHash(<span class="keyword">this</span>));</div>
<div class="line"><a name="l03247"></a><span class="lineno"> 3247</span>&#160;                    this.containers[i].containerCache.over = 0;</div>
<div class="line"><a name="l03248"></a><span class="lineno"> 3248</span>&#160;                }</div>
<div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>&#160;            }</div>
<div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>&#160;</div>
<div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>&#160;        }</div>
<div class="line"><a name="l03252"></a><span class="lineno"> 3252</span>&#160;</div>
<div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>&#160;        <span class="keywordflow">if</span> (this.placeholder) {</div>
<div class="line"><a name="l03254"></a><span class="lineno"> 3254</span>&#160;            <span class="comment">//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!</span></div>
<div class="line"><a name="l03255"></a><span class="lineno"> 3255</span>&#160;            <span class="keywordflow">if</span>(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);</div>
<div class="line"><a name="l03256"></a><span class="lineno"> 3256</span>&#160;            <span class="keywordflow">if</span>(this.options.helper != <span class="stringliteral">&quot;original&quot;</span> &amp;&amp; <span class="keyword">this</span>.helper &amp;&amp; <span class="keyword">this</span>.helper[0].parentNode) this.helper.remove();</div>
<div class="line"><a name="l03257"></a><span class="lineno"> 3257</span>&#160;</div>
<div class="line"><a name="l03258"></a><span class="lineno"> 3258</span>&#160;            $.extend(<span class="keyword">this</span>, {</div>
<div class="line"><a name="l03259"></a><span class="lineno"> 3259</span>&#160;                helper: null,</div>
<div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>&#160;                dragging: <span class="keyword">false</span>,</div>
<div class="line"><a name="l03261"></a><span class="lineno"> 3261</span>&#160;                reverting: <span class="keyword">false</span>,</div>
<div class="line"><a name="l03262"></a><span class="lineno"> 3262</span>&#160;                _noFinalSort: null</div>
<div class="line"><a name="l03263"></a><span class="lineno"> 3263</span>&#160;            });</div>
<div class="line"><a name="l03264"></a><span class="lineno"> 3264</span>&#160;</div>
<div class="line"><a name="l03265"></a><span class="lineno"> 3265</span>&#160;            <span class="keywordflow">if</span>(this.domPosition.prev) {</div>
<div class="line"><a name="l03266"></a><span class="lineno"> 3266</span>&#160;                $(this.domPosition.prev).after(this.currentItem);</div>
<div class="line"><a name="l03267"></a><span class="lineno"> 3267</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03268"></a><span class="lineno"> 3268</span>&#160;                $(this.domPosition.parent).prepend(this.currentItem);</div>
<div class="line"><a name="l03269"></a><span class="lineno"> 3269</span>&#160;            }</div>
<div class="line"><a name="l03270"></a><span class="lineno"> 3270</span>&#160;        }</div>
<div class="line"><a name="l03271"></a><span class="lineno"> 3271</span>&#160;</div>
<div class="line"><a name="l03272"></a><span class="lineno"> 3272</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l03273"></a><span class="lineno"> 3273</span>&#160;</div>
<div class="line"><a name="l03274"></a><span class="lineno"> 3274</span>&#160;    },</div>
<div class="line"><a name="l03275"></a><span class="lineno"> 3275</span>&#160;</div>
<div class="line"><a name="l03276"></a><span class="lineno"> 3276</span>&#160;    serialize: <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l03277"></a><span class="lineno"> 3277</span>&#160;</div>
<div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>&#160;        var items = this._getItemsAsjQuery(o &amp;&amp; o.connected);</div>
<div class="line"><a name="l03279"></a><span class="lineno"> 3279</span>&#160;        var str = []; o = o || {};</div>
<div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>&#160;</div>
<div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>&#160;        $(items).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l03282"></a><span class="lineno"> 3282</span>&#160;            var res = ($(o.item || <span class="keyword">this</span>).attr(o.attribute || <span class="stringliteral">&#39;id&#39;</span>) || <span class="stringliteral">&#39;&#39;</span>).match(o.expression || (/(.+)[-=_](.+)/));</div>
<div class="line"><a name="l03283"></a><span class="lineno"> 3283</span>&#160;            <span class="keywordflow">if</span>(res) str.push((o.key || res[1]+<span class="stringliteral">&#39;[]&#39;</span>)+<span class="charliteral">&#39;=&#39;</span>+(o.key &amp;&amp; o.expression ? res[1] : res[2]));</div>
<div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>&#160;        });</div>
<div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>&#160;</div>
<div class="line"><a name="l03286"></a><span class="lineno"> 3286</span>&#160;        <span class="keywordflow">if</span>(!str.length &amp;&amp; o.key) {</div>
<div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>&#160;            str.push(o.key + <span class="charliteral">&#39;=&#39;</span>);</div>
<div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>&#160;        }</div>
<div class="line"><a name="l03289"></a><span class="lineno"> 3289</span>&#160;</div>
<div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>&#160;        <span class="keywordflow">return</span> str.join(<span class="charliteral">&#39;&amp;&#39;</span>);</div>
<div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>&#160;</div>
<div class="line"><a name="l03292"></a><span class="lineno"> 3292</span>&#160;    },</div>
<div class="line"><a name="l03293"></a><span class="lineno"> 3293</span>&#160;</div>
<div class="line"><a name="l03294"></a><span class="lineno"> 3294</span>&#160;    toArray: <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>&#160;</div>
<div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>&#160;        var items = this._getItemsAsjQuery(o &amp;&amp; o.connected);</div>
<div class="line"><a name="l03297"></a><span class="lineno"> 3297</span>&#160;        var ret = []; o = o || {};</div>
<div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>&#160;</div>
<div class="line"><a name="l03299"></a><span class="lineno"> 3299</span>&#160;        items.each(<span class="keyword">function</span>() { ret.push($(o.item || <span class="keyword">this</span>).attr(o.attribute || <span class="stringliteral">&#39;id&#39;</span>) || <span class="stringliteral">&#39;&#39;</span>); });</div>
<div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>&#160;        <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l03301"></a><span class="lineno"> 3301</span>&#160;</div>
<div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>&#160;    },</div>
<div class="line"><a name="l03303"></a><span class="lineno"> 3303</span>&#160;</div>
<div class="line"><a name="l03304"></a><span class="lineno"> 3304</span>&#160;    <span class="comment">/* Be careful with the following core functions */</span></div>
<div class="line"><a name="l03305"></a><span class="lineno"> 3305</span>&#160;    _intersectsWith: <span class="keyword">function</span>(item) {</div>
<div class="line"><a name="l03306"></a><span class="lineno"> 3306</span>&#160;</div>
<div class="line"><a name="l03307"></a><span class="lineno"> 3307</span>&#160;        var x1 = this.positionAbs.left,</div>
<div class="line"><a name="l03308"></a><span class="lineno"> 3308</span>&#160;            x2 = x1 + this.helperProportions.width,</div>
<div class="line"><a name="l03309"></a><span class="lineno"> 3309</span>&#160;            y1 = this.positionAbs.top,</div>
<div class="line"><a name="l03310"></a><span class="lineno"> 3310</span>&#160;            y2 = y1 + this.helperProportions.height;</div>
<div class="line"><a name="l03311"></a><span class="lineno"> 3311</span>&#160;</div>
<div class="line"><a name="l03312"></a><span class="lineno"> 3312</span>&#160;        var l = item.left,</div>
<div class="line"><a name="l03313"></a><span class="lineno"> 3313</span>&#160;            r = l + item.width,</div>
<div class="line"><a name="l03314"></a><span class="lineno"> 3314</span>&#160;            t = item.top,</div>
<div class="line"><a name="l03315"></a><span class="lineno"> 3315</span>&#160;            b = t + item.height;</div>
<div class="line"><a name="l03316"></a><span class="lineno"> 3316</span>&#160;</div>
<div class="line"><a name="l03317"></a><span class="lineno"> 3317</span>&#160;        var dyClick = this.offset.click.top,</div>
<div class="line"><a name="l03318"></a><span class="lineno"> 3318</span>&#160;            dxClick = this.offset.click.left;</div>
<div class="line"><a name="l03319"></a><span class="lineno"> 3319</span>&#160;</div>
<div class="line"><a name="l03320"></a><span class="lineno"> 3320</span>&#160;        var isOverElement = (y1 + dyClick) &gt; t &amp;&amp; (y1 + dyClick) &lt; b &amp;&amp; (x1 + dxClick) &gt; l &amp;&amp; (x1 + dxClick) &lt; r;</div>
<div class="line"><a name="l03321"></a><span class="lineno"> 3321</span>&#160;</div>
<div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>&#160;        <span class="keywordflow">if</span>(    this.options.tolerance == <span class="stringliteral">&quot;pointer&quot;</span></div>
<div class="line"><a name="l03323"></a><span class="lineno"> 3323</span>&#160;            || <span class="keyword">this</span>.options.forcePointerForContainers</div>
<div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>&#160;            || (<span class="keyword">this</span>.options.tolerance != <span class="stringliteral">&quot;pointer&quot;</span> &amp;&amp; <span class="keyword">this</span>.helperProportions[<span class="keyword">this</span>.floating ? <span class="stringliteral">&#39;width&#39;</span> : <span class="stringliteral">&#39;height&#39;</span>] &gt; item[<span class="keyword">this</span>.floating ? <span class="stringliteral">&#39;width&#39;</span> : <span class="stringliteral">&#39;height&#39;</span>])</div>
<div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>&#160;        ) {</div>
<div class="line"><a name="l03326"></a><span class="lineno"> 3326</span>&#160;            <span class="keywordflow">return</span> isOverElement;</div>
<div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>&#160;</div>
<div class="line"><a name="l03329"></a><span class="lineno"> 3329</span>&#160;            <span class="keywordflow">return</span> (l &lt; x1 + (this.helperProportions.width / 2) <span class="comment">// Right Half</span></div>
<div class="line"><a name="l03330"></a><span class="lineno"> 3330</span>&#160;                &amp;&amp; x2 - (this.helperProportions.width / 2) &lt; r <span class="comment">// Left Half</span></div>
<div class="line"><a name="l03331"></a><span class="lineno"> 3331</span>&#160;                &amp;&amp; t &lt; y1 + (this.helperProportions.height / 2) <span class="comment">// Bottom Half</span></div>
<div class="line"><a name="l03332"></a><span class="lineno"> 3332</span>&#160;                &amp;&amp; y2 - (this.helperProportions.height / 2) &lt; b ); <span class="comment">// Top Half</span></div>
<div class="line"><a name="l03333"></a><span class="lineno"> 3333</span>&#160;</div>
<div class="line"><a name="l03334"></a><span class="lineno"> 3334</span>&#160;        }</div>
<div class="line"><a name="l03335"></a><span class="lineno"> 3335</span>&#160;    },</div>
<div class="line"><a name="l03336"></a><span class="lineno"> 3336</span>&#160;</div>
<div class="line"><a name="l03337"></a><span class="lineno"> 3337</span>&#160;    _intersectsWithPointer: <span class="keyword">function</span>(item) {</div>
<div class="line"><a name="l03338"></a><span class="lineno"> 3338</span>&#160;</div>
<div class="line"><a name="l03339"></a><span class="lineno"> 3339</span>&#160;        var isOverElementHeight = (this.options.axis === <span class="charliteral">&#39;x&#39;</span>) || $.ui.isOverAxis(<span class="keyword">this</span>.positionAbs.top + <span class="keyword">this</span>.offset.click.top, item.top, item.height),</div>
<div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>&#160;            isOverElementWidth = (this.options.axis === <span class="charliteral">&#39;y&#39;</span>) || $.ui.isOverAxis(<span class="keyword">this</span>.positionAbs.left + <span class="keyword">this</span>.offset.click.left, item.left, item.width),</div>
<div class="line"><a name="l03341"></a><span class="lineno"> 3341</span>&#160;            isOverElement = isOverElementHeight &amp;&amp; isOverElementWidth,</div>
<div class="line"><a name="l03342"></a><span class="lineno"> 3342</span>&#160;            verticalDirection = this._getDragVerticalDirection(),</div>
<div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>&#160;            horizontalDirection = this._getDragHorizontalDirection();</div>
<div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>&#160;</div>
<div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>&#160;        <span class="keywordflow">if</span> (!isOverElement)</div>
<div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>&#160;</div>
<div class="line"><a name="l03348"></a><span class="lineno"> 3348</span>&#160;        <span class="keywordflow">return</span> this.floating ?</div>
<div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>&#160;            ( ((horizontalDirection &amp;&amp; horizontalDirection == <span class="stringliteral">&quot;right&quot;</span>) || verticalDirection == <span class="stringliteral">&quot;down&quot;</span>) ? 2 : 1 )</div>
<div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>&#160;            : ( verticalDirection &amp;&amp; (verticalDirection == <span class="stringliteral">&quot;down&quot;</span> ? 2 : 1) );</div>
<div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>&#160;</div>
<div class="line"><a name="l03352"></a><span class="lineno"> 3352</span>&#160;    },</div>
<div class="line"><a name="l03353"></a><span class="lineno"> 3353</span>&#160;</div>
<div class="line"><a name="l03354"></a><span class="lineno"> 3354</span>&#160;    _intersectsWithSides: <span class="keyword">function</span>(item) {</div>
<div class="line"><a name="l03355"></a><span class="lineno"> 3355</span>&#160;</div>
<div class="line"><a name="l03356"></a><span class="lineno"> 3356</span>&#160;        var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + <span class="keyword">this</span>.offset.click.top, item.top + (item.height/2), item.height),</div>
<div class="line"><a name="l03357"></a><span class="lineno"> 3357</span>&#160;            isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + <span class="keyword">this</span>.offset.click.left, item.left + (item.width/2), item.width),</div>
<div class="line"><a name="l03358"></a><span class="lineno"> 3358</span>&#160;            verticalDirection = this._getDragVerticalDirection(),</div>
<div class="line"><a name="l03359"></a><span class="lineno"> 3359</span>&#160;            horizontalDirection = this._getDragHorizontalDirection();</div>
<div class="line"><a name="l03360"></a><span class="lineno"> 3360</span>&#160;</div>
<div class="line"><a name="l03361"></a><span class="lineno"> 3361</span>&#160;        <span class="keywordflow">if</span> (this.floating &amp;&amp; horizontalDirection) {</div>
<div class="line"><a name="l03362"></a><span class="lineno"> 3362</span>&#160;            <span class="keywordflow">return</span> ((horizontalDirection == <span class="stringliteral">&quot;right&quot;</span> &amp;&amp; isOverRightHalf) || (horizontalDirection == <span class="stringliteral">&quot;left&quot;</span> &amp;&amp; !isOverRightHalf));</div>
<div class="line"><a name="l03363"></a><span class="lineno"> 3363</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03364"></a><span class="lineno"> 3364</span>&#160;            <span class="keywordflow">return</span> verticalDirection &amp;&amp; ((verticalDirection == <span class="stringliteral">&quot;down&quot;</span> &amp;&amp; isOverBottomHalf) || (verticalDirection == <span class="stringliteral">&quot;up&quot;</span> &amp;&amp; !isOverBottomHalf));</div>
<div class="line"><a name="l03365"></a><span class="lineno"> 3365</span>&#160;        }</div>
<div class="line"><a name="l03366"></a><span class="lineno"> 3366</span>&#160;</div>
<div class="line"><a name="l03367"></a><span class="lineno"> 3367</span>&#160;    },</div>
<div class="line"><a name="l03368"></a><span class="lineno"> 3368</span>&#160;</div>
<div class="line"><a name="l03369"></a><span class="lineno"> 3369</span>&#160;    _getDragVerticalDirection: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03370"></a><span class="lineno"> 3370</span>&#160;        var delta = this.positionAbs.top - this.lastPositionAbs.top;</div>
<div class="line"><a name="l03371"></a><span class="lineno"> 3371</span>&#160;        <span class="keywordflow">return</span> delta != 0 &amp;&amp; (delta &gt; 0 ? <span class="stringliteral">&quot;down&quot;</span> : <span class="stringliteral">&quot;up&quot;</span>);</div>
<div class="line"><a name="l03372"></a><span class="lineno"> 3372</span>&#160;    },</div>
<div class="line"><a name="l03373"></a><span class="lineno"> 3373</span>&#160;</div>
<div class="line"><a name="l03374"></a><span class="lineno"> 3374</span>&#160;    _getDragHorizontalDirection: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03375"></a><span class="lineno"> 3375</span>&#160;        var delta = this.positionAbs.left - this.lastPositionAbs.left;</div>
<div class="line"><a name="l03376"></a><span class="lineno"> 3376</span>&#160;        <span class="keywordflow">return</span> delta != 0 &amp;&amp; (delta &gt; 0 ? <span class="stringliteral">&quot;right&quot;</span> : <span class="stringliteral">&quot;left&quot;</span>);</div>
<div class="line"><a name="l03377"></a><span class="lineno"> 3377</span>&#160;    },</div>
<div class="line"><a name="l03378"></a><span class="lineno"> 3378</span>&#160;</div>
<div class="line"><a name="l03379"></a><span class="lineno"> 3379</span>&#160;    refresh: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l03380"></a><span class="lineno"> 3380</span>&#160;        this._refreshItems(event);</div>
<div class="line"><a name="l03381"></a><span class="lineno"> 3381</span>&#160;        this.refreshPositions();</div>
<div class="line"><a name="l03382"></a><span class="lineno"> 3382</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l03383"></a><span class="lineno"> 3383</span>&#160;    },</div>
<div class="line"><a name="l03384"></a><span class="lineno"> 3384</span>&#160;</div>
<div class="line"><a name="l03385"></a><span class="lineno"> 3385</span>&#160;    _connectWith: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03386"></a><span class="lineno"> 3386</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l03387"></a><span class="lineno"> 3387</span>&#160;        <span class="keywordflow">return</span> options.connectWith.constructor == String</div>
<div class="line"><a name="l03388"></a><span class="lineno"> 3388</span>&#160;            ? [options.connectWith]</div>
<div class="line"><a name="l03389"></a><span class="lineno"> 3389</span>&#160;            : options.connectWith;</div>
<div class="line"><a name="l03390"></a><span class="lineno"> 3390</span>&#160;    },</div>
<div class="line"><a name="l03391"></a><span class="lineno"> 3391</span>&#160;    </div>
<div class="line"><a name="l03392"></a><span class="lineno"> 3392</span>&#160;    _getItemsAsjQuery: <span class="keyword">function</span>(connected) {</div>
<div class="line"><a name="l03393"></a><span class="lineno"> 3393</span>&#160;</div>
<div class="line"><a name="l03394"></a><span class="lineno"> 3394</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l03395"></a><span class="lineno"> 3395</span>&#160;        var items = [];</div>
<div class="line"><a name="l03396"></a><span class="lineno"> 3396</span>&#160;        var queries = [];</div>
<div class="line"><a name="l03397"></a><span class="lineno"> 3397</span>&#160;        var connectWith = this._connectWith();</div>
<div class="line"><a name="l03398"></a><span class="lineno"> 3398</span>&#160;</div>
<div class="line"><a name="l03399"></a><span class="lineno"> 3399</span>&#160;        <span class="keywordflow">if</span>(connectWith &amp;&amp; connected) {</div>
<div class="line"><a name="l03400"></a><span class="lineno"> 3400</span>&#160;            <span class="keywordflow">for</span> (var i = connectWith.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03401"></a><span class="lineno"> 3401</span>&#160;                var cur = $(connectWith[i]);</div>
<div class="line"><a name="l03402"></a><span class="lineno"> 3402</span>&#160;                <span class="keywordflow">for</span> (var j = cur.length - 1; j &gt;= 0; j--){</div>
<div class="line"><a name="l03403"></a><span class="lineno"> 3403</span>&#160;                    var inst = $.data(cur[j], this.widgetName);</div>
<div class="line"><a name="l03404"></a><span class="lineno"> 3404</span>&#160;                    <span class="keywordflow">if</span>(inst &amp;&amp; inst != <span class="keyword">this</span> &amp;&amp; !inst.options.disabled) {</div>
<div class="line"><a name="l03405"></a><span class="lineno"> 3405</span>&#160;                        queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(<span class="stringliteral">&quot;.ui-sortable-helper&quot;</span>).not(<span class="stringliteral">&#39;.ui-sortable-placeholder&#39;</span>), inst]);</div>
<div class="line"><a name="l03406"></a><span class="lineno"> 3406</span>&#160;                    }</div>
<div class="line"><a name="l03407"></a><span class="lineno"> 3407</span>&#160;                };</div>
<div class="line"><a name="l03408"></a><span class="lineno"> 3408</span>&#160;            };</div>
<div class="line"><a name="l03409"></a><span class="lineno"> 3409</span>&#160;        }</div>
<div class="line"><a name="l03410"></a><span class="lineno"> 3410</span>&#160;</div>
<div class="line"><a name="l03411"></a><span class="lineno"> 3411</span>&#160;        queries.push([$.isFunction(this.options.items) ? <span class="keyword">this</span>.options.items.call(<span class="keyword">this</span>.element, null, { options: <span class="keyword">this</span>.options, item: <span class="keyword">this</span>.currentItem }) : $(this.options.items, <span class="keyword">this</span>.element).not(<span class="stringliteral">&quot;.ui-sortable-helper&quot;</span>).not(<span class="stringliteral">&#39;.ui-sortable-placeholder&#39;</span>), <span class="keyword">this</span>]);</div>
<div class="line"><a name="l03412"></a><span class="lineno"> 3412</span>&#160;</div>
<div class="line"><a name="l03413"></a><span class="lineno"> 3413</span>&#160;        <span class="keywordflow">for</span> (var i = queries.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03414"></a><span class="lineno"> 3414</span>&#160;            queries[i][0].each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l03415"></a><span class="lineno"> 3415</span>&#160;                items.push(<span class="keyword">this</span>);</div>
<div class="line"><a name="l03416"></a><span class="lineno"> 3416</span>&#160;            });</div>
<div class="line"><a name="l03417"></a><span class="lineno"> 3417</span>&#160;        };</div>
<div class="line"><a name="l03418"></a><span class="lineno"> 3418</span>&#160;</div>
<div class="line"><a name="l03419"></a><span class="lineno"> 3419</span>&#160;        <span class="keywordflow">return</span> $(items);</div>
<div class="line"><a name="l03420"></a><span class="lineno"> 3420</span>&#160;</div>
<div class="line"><a name="l03421"></a><span class="lineno"> 3421</span>&#160;    },</div>
<div class="line"><a name="l03422"></a><span class="lineno"> 3422</span>&#160;</div>
<div class="line"><a name="l03423"></a><span class="lineno"> 3423</span>&#160;    _removeCurrentsFromItems: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03424"></a><span class="lineno"> 3424</span>&#160;</div>
<div class="line"><a name="l03425"></a><span class="lineno"> 3425</span>&#160;        var list = this.currentItem.find(<span class="stringliteral">&quot;:data(&quot;</span> + this.widgetName + <span class="stringliteral">&quot;-item)&quot;</span>);</div>
<div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>&#160;</div>
<div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>&#160;        <span class="keywordflow">for</span> (var i=0; i &lt; this.items.length; i++) {</div>
<div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>&#160;</div>
<div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>&#160;            <span class="keywordflow">for</span> (var j=0; j &lt; list.length; j++) {</div>
<div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>&#160;                <span class="keywordflow">if</span>(list[j] == this.items[i].item[0])</div>
<div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>&#160;                    this.items.splice(i,1);</div>
<div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>&#160;            };</div>
<div class="line"><a name="l03433"></a><span class="lineno"> 3433</span>&#160;</div>
<div class="line"><a name="l03434"></a><span class="lineno"> 3434</span>&#160;        };</div>
<div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>&#160;</div>
<div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>&#160;    },</div>
<div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>&#160;</div>
<div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>&#160;    _refreshItems: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l03439"></a><span class="lineno"> 3439</span>&#160;</div>
<div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>&#160;        this.items = [];</div>
<div class="line"><a name="l03441"></a><span class="lineno"> 3441</span>&#160;        this.containers = [<span class="keyword">this</span>];</div>
<div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>&#160;        var items = this.items;</div>
<div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>&#160;        var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, <span class="keyword">this</span>.element), <span class="keyword">this</span>]];</div>
<div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>&#160;        var connectWith = this._connectWith();</div>
<div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>&#160;</div>
<div class="line"><a name="l03447"></a><span class="lineno"> 3447</span>&#160;        <span class="keywordflow">if</span>(connectWith &amp;&amp; this.ready) { <span class="comment">//Shouldn&#39;t be run the first time through due to massive slow-down</span></div>
<div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>&#160;            <span class="keywordflow">for</span> (var i = connectWith.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>&#160;                var cur = $(connectWith[i]);</div>
<div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>&#160;                <span class="keywordflow">for</span> (var j = cur.length - 1; j &gt;= 0; j--){</div>
<div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>&#160;                    var inst = $.data(cur[j], this.widgetName);</div>
<div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>&#160;                    <span class="keywordflow">if</span>(inst &amp;&amp; inst != <span class="keyword">this</span> &amp;&amp; !inst.options.disabled) {</div>
<div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>&#160;                        queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: <span class="keyword">this</span>.currentItem }) : $(inst.options.items, inst.element), inst]);</div>
<div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>&#160;                        this.containers.push(inst);</div>
<div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>&#160;                    }</div>
<div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>&#160;                };</div>
<div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>&#160;            };</div>
<div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>&#160;        }</div>
<div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>&#160;</div>
<div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>&#160;        <span class="keywordflow">for</span> (var i = queries.length - 1; i &gt;= 0; i--) {</div>
<div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>&#160;            var targetData = queries[i][1];</div>
<div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>&#160;            var _queries = queries[i][0];</div>
<div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>&#160;</div>
<div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>&#160;            <span class="keywordflow">for</span> (var j=0, queriesLength = _queries.length; j &lt; queriesLength; j++) {</div>
<div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>&#160;                var item = $(_queries[j]);</div>
<div class="line"><a name="l03466"></a><span class="lineno"> 3466</span>&#160;</div>
<div class="line"><a name="l03467"></a><span class="lineno"> 3467</span>&#160;                item.data(this.widgetName + <span class="stringliteral">&#39;-item&#39;</span>, targetData); <span class="comment">// Data for target checking (mouse manager)</span></div>
<div class="line"><a name="l03468"></a><span class="lineno"> 3468</span>&#160;</div>
<div class="line"><a name="l03469"></a><span class="lineno"> 3469</span>&#160;                items.push({</div>
<div class="line"><a name="l03470"></a><span class="lineno"> 3470</span>&#160;                    item: item,</div>
<div class="line"><a name="l03471"></a><span class="lineno"> 3471</span>&#160;                    instance: targetData,</div>
<div class="line"><a name="l03472"></a><span class="lineno"> 3472</span>&#160;                    width: 0, height: 0,</div>
<div class="line"><a name="l03473"></a><span class="lineno"> 3473</span>&#160;                    left: 0, top: 0</div>
<div class="line"><a name="l03474"></a><span class="lineno"> 3474</span>&#160;                });</div>
<div class="line"><a name="l03475"></a><span class="lineno"> 3475</span>&#160;            };</div>
<div class="line"><a name="l03476"></a><span class="lineno"> 3476</span>&#160;        };</div>
<div class="line"><a name="l03477"></a><span class="lineno"> 3477</span>&#160;</div>
<div class="line"><a name="l03478"></a><span class="lineno"> 3478</span>&#160;    },</div>
<div class="line"><a name="l03479"></a><span class="lineno"> 3479</span>&#160;</div>
<div class="line"><a name="l03480"></a><span class="lineno"> 3480</span>&#160;    refreshPositions: <span class="keyword">function</span>(fast) {</div>
<div class="line"><a name="l03481"></a><span class="lineno"> 3481</span>&#160;</div>
<div class="line"><a name="l03482"></a><span class="lineno"> 3482</span>&#160;        <span class="comment">//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent&#39;s position will change</span></div>
<div class="line"><a name="l03483"></a><span class="lineno"> 3483</span>&#160;        <span class="keywordflow">if</span>(this.offsetParent &amp;&amp; this.helper) {</div>
<div class="line"><a name="l03484"></a><span class="lineno"> 3484</span>&#160;            this.offset.parent = this._getParentOffset();</div>
<div class="line"><a name="l03485"></a><span class="lineno"> 3485</span>&#160;        }</div>
<div class="line"><a name="l03486"></a><span class="lineno"> 3486</span>&#160;</div>
<div class="line"><a name="l03487"></a><span class="lineno"> 3487</span>&#160;        <span class="keywordflow">for</span> (var i = this.items.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03488"></a><span class="lineno"> 3488</span>&#160;            var item = this.items[i];</div>
<div class="line"><a name="l03489"></a><span class="lineno"> 3489</span>&#160;</div>
<div class="line"><a name="l03490"></a><span class="lineno"> 3490</span>&#160;            <span class="comment">//We ignore calculating positions of all connected containers when we&#39;re not over them</span></div>
<div class="line"><a name="l03491"></a><span class="lineno"> 3491</span>&#160;            <span class="keywordflow">if</span>(item.instance != <span class="keyword">this</span>.currentContainer &amp;&amp; <span class="keyword">this</span>.currentContainer &amp;&amp; item.item[0] != <span class="keyword">this</span>.currentItem[0])</div>
<div class="line"><a name="l03492"></a><span class="lineno"> 3492</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03493"></a><span class="lineno"> 3493</span>&#160;</div>
<div class="line"><a name="l03494"></a><span class="lineno"> 3494</span>&#160;            var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;</div>
<div class="line"><a name="l03495"></a><span class="lineno"> 3495</span>&#160;</div>
<div class="line"><a name="l03496"></a><span class="lineno"> 3496</span>&#160;            if (!fast) {</div>
<div class="line"><a name="l03497"></a><span class="lineno"> 3497</span>&#160;                item.width = t.outerWidth();</div>
<div class="line"><a name="l03498"></a><span class="lineno"> 3498</span>&#160;                item.height = t.outerHeight();</div>
<div class="line"><a name="l03499"></a><span class="lineno"> 3499</span>&#160;            }</div>
<div class="line"><a name="l03500"></a><span class="lineno"> 3500</span>&#160;</div>
<div class="line"><a name="l03501"></a><span class="lineno"> 3501</span>&#160;            var p = t.offset();</div>
<div class="line"><a name="l03502"></a><span class="lineno"> 3502</span>&#160;            item.left = p.left;</div>
<div class="line"><a name="l03503"></a><span class="lineno"> 3503</span>&#160;            item.top = p.top;</div>
<div class="line"><a name="l03504"></a><span class="lineno"> 3504</span>&#160;        };</div>
<div class="line"><a name="l03505"></a><span class="lineno"> 3505</span>&#160;</div>
<div class="line"><a name="l03506"></a><span class="lineno"> 3506</span>&#160;        <span class="keywordflow">if</span>(this.options.custom &amp;&amp; <span class="keyword">this</span>.options.custom.refreshContainers) {</div>
<div class="line"><a name="l03507"></a><span class="lineno"> 3507</span>&#160;            this.options.custom.refreshContainers.call(<span class="keyword">this</span>);</div>
<div class="line"><a name="l03508"></a><span class="lineno"> 3508</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03509"></a><span class="lineno"> 3509</span>&#160;            <span class="keywordflow">for</span> (var i = this.containers.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03510"></a><span class="lineno"> 3510</span>&#160;                var p = this.containers[i].element.offset();</div>
<div class="line"><a name="l03511"></a><span class="lineno"> 3511</span>&#160;                this.containers[i].containerCache.left = p.left;</div>
<div class="line"><a name="l03512"></a><span class="lineno"> 3512</span>&#160;                this.containers[i].containerCache.top = p.top;</div>
<div class="line"><a name="l03513"></a><span class="lineno"> 3513</span>&#160;                this.containers[i].containerCache.width = this.containers[i].element.outerWidth();</div>
<div class="line"><a name="l03514"></a><span class="lineno"> 3514</span>&#160;                this.containers[i].containerCache.height = this.containers[i].element.outerHeight();</div>
<div class="line"><a name="l03515"></a><span class="lineno"> 3515</span>&#160;            };</div>
<div class="line"><a name="l03516"></a><span class="lineno"> 3516</span>&#160;        }</div>
<div class="line"><a name="l03517"></a><span class="lineno"> 3517</span>&#160;</div>
<div class="line"><a name="l03518"></a><span class="lineno"> 3518</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l03519"></a><span class="lineno"> 3519</span>&#160;    },</div>
<div class="line"><a name="l03520"></a><span class="lineno"> 3520</span>&#160;</div>
<div class="line"><a name="l03521"></a><span class="lineno"> 3521</span>&#160;    _createPlaceholder: <span class="keyword">function</span>(that) {</div>
<div class="line"><a name="l03522"></a><span class="lineno"> 3522</span>&#160;</div>
<div class="line"><a name="l03523"></a><span class="lineno"> 3523</span>&#160;        var <span class="keyword">self</span> = that || <span class="keyword">this</span>, o = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l03524"></a><span class="lineno"> 3524</span>&#160;</div>
<div class="line"><a name="l03525"></a><span class="lineno"> 3525</span>&#160;        <span class="keywordflow">if</span>(!o.placeholder || o.placeholder.constructor == String) {</div>
<div class="line"><a name="l03526"></a><span class="lineno"> 3526</span>&#160;            var className = o.placeholder;</div>
<div class="line"><a name="l03527"></a><span class="lineno"> 3527</span>&#160;            o.placeholder = {</div>
<div class="line"><a name="l03528"></a><span class="lineno"> 3528</span>&#160;                element: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03529"></a><span class="lineno"> 3529</span>&#160;</div>
<div class="line"><a name="l03530"></a><span class="lineno"> 3530</span>&#160;                    var el = $(document.createElement(<span class="keyword">self</span>.currentItem[0].nodeName))</div>
<div class="line"><a name="l03531"></a><span class="lineno"> 3531</span>&#160;                        .addClass(className || <span class="keyword">self</span>.currentItem[0].className+<span class="stringliteral">&quot; ui-sortable-placeholder&quot;</span>)</div>
<div class="line"><a name="l03532"></a><span class="lineno"> 3532</span>&#160;                        .removeClass(<span class="stringliteral">&quot;ui-sortable-helper&quot;</span>)[0];</div>
<div class="line"><a name="l03533"></a><span class="lineno"> 3533</span>&#160;</div>
<div class="line"><a name="l03534"></a><span class="lineno"> 3534</span>&#160;                    <span class="keywordflow">if</span>(!className)</div>
<div class="line"><a name="l03535"></a><span class="lineno"> 3535</span>&#160;                        el.style.visibility = <span class="stringliteral">&quot;hidden&quot;</span>;</div>
<div class="line"><a name="l03536"></a><span class="lineno"> 3536</span>&#160;</div>
<div class="line"><a name="l03537"></a><span class="lineno"> 3537</span>&#160;                    <span class="keywordflow">return</span> el;</div>
<div class="line"><a name="l03538"></a><span class="lineno"> 3538</span>&#160;                },</div>
<div class="line"><a name="l03539"></a><span class="lineno"> 3539</span>&#160;                update: <span class="keyword">function</span>(container, p) {</div>
<div class="line"><a name="l03540"></a><span class="lineno"> 3540</span>&#160;</div>
<div class="line"><a name="l03541"></a><span class="lineno"> 3541</span>&#160;                    <span class="comment">// 1. If a className is set as &#39;placeholder option, we don&#39;t force sizes - the class is responsible for that</span></div>
<div class="line"><a name="l03542"></a><span class="lineno"> 3542</span>&#160;                    <span class="comment">// 2. The option &#39;forcePlaceholderSize can be enabled to force it even if a class name is specified</span></div>
<div class="line"><a name="l03543"></a><span class="lineno"> 3543</span>&#160;                    <span class="keywordflow">if</span>(className &amp;&amp; !o.forcePlaceholderSize) <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l03544"></a><span class="lineno"> 3544</span>&#160;</div>
<div class="line"><a name="l03545"></a><span class="lineno"> 3545</span>&#160;                    <span class="comment">//If the element doesn&#39;t have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item</span></div>
<div class="line"><a name="l03546"></a><span class="lineno"> 3546</span>&#160;                    <span class="keywordflow">if</span>(!p.height()) { p.height(<span class="keyword">self</span>.currentItem.innerHeight() - parseInt(<span class="keyword">self</span>.currentItem.css(<span class="stringliteral">&#39;paddingTop&#39;</span>)||0, 10) - parseInt(<span class="keyword">self</span>.currentItem.css(<span class="stringliteral">&#39;paddingBottom&#39;</span>)||0, 10)); };</div>
<div class="line"><a name="l03547"></a><span class="lineno"> 3547</span>&#160;                    <span class="keywordflow">if</span>(!p.width()) { p.width(<span class="keyword">self</span>.currentItem.innerWidth() - parseInt(<span class="keyword">self</span>.currentItem.css(<span class="stringliteral">&#39;paddingLeft&#39;</span>)||0, 10) - parseInt(<span class="keyword">self</span>.currentItem.css(<span class="stringliteral">&#39;paddingRight&#39;</span>)||0, 10)); };</div>
<div class="line"><a name="l03548"></a><span class="lineno"> 3548</span>&#160;                }</div>
<div class="line"><a name="l03549"></a><span class="lineno"> 3549</span>&#160;            };</div>
<div class="line"><a name="l03550"></a><span class="lineno"> 3550</span>&#160;        }</div>
<div class="line"><a name="l03551"></a><span class="lineno"> 3551</span>&#160;</div>
<div class="line"><a name="l03552"></a><span class="lineno"> 3552</span>&#160;        <span class="comment">//Create the placeholder</span></div>
<div class="line"><a name="l03553"></a><span class="lineno"> 3553</span>&#160;        <span class="keyword">self</span>.placeholder = $(o.placeholder.element.call(<span class="keyword">self</span>.element, <span class="keyword">self</span>.currentItem));</div>
<div class="line"><a name="l03554"></a><span class="lineno"> 3554</span>&#160;</div>
<div class="line"><a name="l03555"></a><span class="lineno"> 3555</span>&#160;        <span class="comment">//Append it after the actual current item</span></div>
<div class="line"><a name="l03556"></a><span class="lineno"> 3556</span>&#160;        <span class="keyword">self</span>.currentItem.after(<span class="keyword">self</span>.placeholder);</div>
<div class="line"><a name="l03557"></a><span class="lineno"> 3557</span>&#160;</div>
<div class="line"><a name="l03558"></a><span class="lineno"> 3558</span>&#160;        <span class="comment">//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)</span></div>
<div class="line"><a name="l03559"></a><span class="lineno"> 3559</span>&#160;        o.placeholder.update(<span class="keyword">self</span>, <span class="keyword">self</span>.placeholder);</div>
<div class="line"><a name="l03560"></a><span class="lineno"> 3560</span>&#160;</div>
<div class="line"><a name="l03561"></a><span class="lineno"> 3561</span>&#160;    },</div>
<div class="line"><a name="l03562"></a><span class="lineno"> 3562</span>&#160;</div>
<div class="line"><a name="l03563"></a><span class="lineno"> 3563</span>&#160;    _contactContainers: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l03564"></a><span class="lineno"> 3564</span>&#160;        </div>
<div class="line"><a name="l03565"></a><span class="lineno"> 3565</span>&#160;        <span class="comment">// get innermost container that intersects with item </span></div>
<div class="line"><a name="l03566"></a><span class="lineno"> 3566</span>&#160;        var innermostContainer = null, innermostIndex = null;       </div>
<div class="line"><a name="l03567"></a><span class="lineno"> 3567</span>&#160;        </div>
<div class="line"><a name="l03568"></a><span class="lineno"> 3568</span>&#160;        </div>
<div class="line"><a name="l03569"></a><span class="lineno"> 3569</span>&#160;        <span class="keywordflow">for</span> (var i = this.containers.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03570"></a><span class="lineno"> 3570</span>&#160;</div>
<div class="line"><a name="l03571"></a><span class="lineno"> 3571</span>&#160;            <span class="comment">// never consider a container that&#39;s located within the item itself </span></div>
<div class="line"><a name="l03572"></a><span class="lineno"> 3572</span>&#160;            <span class="keywordflow">if</span>($.ui.contains(<span class="keyword">this</span>.currentItem[0], <span class="keyword">this</span>.containers[i].element[0]))</div>
<div class="line"><a name="l03573"></a><span class="lineno"> 3573</span>&#160;                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03574"></a><span class="lineno"> 3574</span>&#160;</div>
<div class="line"><a name="l03575"></a><span class="lineno"> 3575</span>&#160;            <span class="keywordflow">if</span>(this._intersectsWith(this.containers[i].containerCache)) {</div>
<div class="line"><a name="l03576"></a><span class="lineno"> 3576</span>&#160;</div>
<div class="line"><a name="l03577"></a><span class="lineno"> 3577</span>&#160;                <span class="comment">// if we&#39;ve already found a container and it&#39;s more &quot;inner&quot; than this, then continue </span></div>
<div class="line"><a name="l03578"></a><span class="lineno"> 3578</span>&#160;                <span class="keywordflow">if</span>(innermostContainer &amp;&amp; $.ui.contains(<span class="keyword">this</span>.containers[i].element[0], innermostContainer.element[0]))</div>
<div class="line"><a name="l03579"></a><span class="lineno"> 3579</span>&#160;                    <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l03580"></a><span class="lineno"> 3580</span>&#160;</div>
<div class="line"><a name="l03581"></a><span class="lineno"> 3581</span>&#160;                innermostContainer = this.containers[i]; </div>
<div class="line"><a name="l03582"></a><span class="lineno"> 3582</span>&#160;                innermostIndex = i;</div>
<div class="line"><a name="l03583"></a><span class="lineno"> 3583</span>&#160;                    </div>
<div class="line"><a name="l03584"></a><span class="lineno"> 3584</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03585"></a><span class="lineno"> 3585</span>&#160;                <span class="comment">// container doesn&#39;t intersect. trigger &quot;out&quot; event if necessary </span></div>
<div class="line"><a name="l03586"></a><span class="lineno"> 3586</span>&#160;                <span class="keywordflow">if</span>(this.containers[i].containerCache.over) {</div>
<div class="line"><a name="l03587"></a><span class="lineno"> 3587</span>&#160;                    this.containers[i]._trigger(<span class="stringliteral">&quot;out&quot;</span>, event, this._uiHash(<span class="keyword">this</span>));</div>
<div class="line"><a name="l03588"></a><span class="lineno"> 3588</span>&#160;                    this.containers[i].containerCache.over = 0;</div>
<div class="line"><a name="l03589"></a><span class="lineno"> 3589</span>&#160;                }</div>
<div class="line"><a name="l03590"></a><span class="lineno"> 3590</span>&#160;            }</div>
<div class="line"><a name="l03591"></a><span class="lineno"> 3591</span>&#160;</div>
<div class="line"><a name="l03592"></a><span class="lineno"> 3592</span>&#160;        }</div>
<div class="line"><a name="l03593"></a><span class="lineno"> 3593</span>&#160;        </div>
<div class="line"><a name="l03594"></a><span class="lineno"> 3594</span>&#160;        <span class="comment">// if no intersecting containers found, return </span></div>
<div class="line"><a name="l03595"></a><span class="lineno"> 3595</span>&#160;        <span class="keywordflow">if</span>(!innermostContainer) <span class="keywordflow">return</span>; </div>
<div class="line"><a name="l03596"></a><span class="lineno"> 3596</span>&#160;</div>
<div class="line"><a name="l03597"></a><span class="lineno"> 3597</span>&#160;        <span class="comment">// move the item into the container if it&#39;s not there already</span></div>
<div class="line"><a name="l03598"></a><span class="lineno"> 3598</span>&#160;        <span class="keywordflow">if</span>(this.containers.length === 1) {</div>
<div class="line"><a name="l03599"></a><span class="lineno"> 3599</span>&#160;            this.containers[innermostIndex]._trigger(<span class="stringliteral">&quot;over&quot;</span>, event, this._uiHash(<span class="keyword">this</span>));</div>
<div class="line"><a name="l03600"></a><span class="lineno"> 3600</span>&#160;            this.containers[innermostIndex].containerCache.over = 1;</div>
<div class="line"><a name="l03601"></a><span class="lineno"> 3601</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(this.currentContainer != this.containers[innermostIndex]) { </div>
<div class="line"><a name="l03602"></a><span class="lineno"> 3602</span>&#160;</div>
<div class="line"><a name="l03603"></a><span class="lineno"> 3603</span>&#160;            <span class="comment">//When entering a new container, we will find the item with the least distance and append our item near it </span></div>
<div class="line"><a name="l03604"></a><span class="lineno"> 3604</span>&#160;            var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? <span class="stringliteral">&#39;left&#39;</span> : <span class="stringliteral">&#39;top&#39;</span>]; </div>
<div class="line"><a name="l03605"></a><span class="lineno"> 3605</span>&#160;            <span class="keywordflow">for</span> (var j = this.items.length - 1; j &gt;= 0; j--) { </div>
<div class="line"><a name="l03606"></a><span class="lineno"> 3606</span>&#160;                <span class="keywordflow">if</span>(!$.ui.contains(<span class="keyword">this</span>.containers[innermostIndex].element[0], <span class="keyword">this</span>.items[j].item[0])) <span class="keywordflow">continue</span>; </div>
<div class="line"><a name="l03607"></a><span class="lineno"> 3607</span>&#160;                var cur = this.items[j][this.containers[innermostIndex].floating ? <span class="stringliteral">&#39;left&#39;</span> : <span class="stringliteral">&#39;top&#39;</span>]; </div>
<div class="line"><a name="l03608"></a><span class="lineno"> 3608</span>&#160;                <span class="keywordflow">if</span>(Math.abs(cur - base) &lt; dist) { </div>
<div class="line"><a name="l03609"></a><span class="lineno"> 3609</span>&#160;                    dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; </div>
<div class="line"><a name="l03610"></a><span class="lineno"> 3610</span>&#160;                } </div>
<div class="line"><a name="l03611"></a><span class="lineno"> 3611</span>&#160;            } </div>
<div class="line"><a name="l03612"></a><span class="lineno"> 3612</span>&#160;</div>
<div class="line"><a name="l03613"></a><span class="lineno"> 3613</span>&#160;            <span class="keywordflow">if</span>(!itemWithLeastDistance &amp;&amp; !this.options.dropOnEmpty) <span class="comment">//Check if dropOnEmpty is enabled </span></div>
<div class="line"><a name="l03614"></a><span class="lineno"> 3614</span>&#160;                <span class="keywordflow">return</span>; </div>
<div class="line"><a name="l03615"></a><span class="lineno"> 3615</span>&#160;</div>
<div class="line"><a name="l03616"></a><span class="lineno"> 3616</span>&#160;            this.currentContainer = this.containers[innermostIndex]; </div>
<div class="line"><a name="l03617"></a><span class="lineno"> 3617</span>&#160;            itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, <span class="keyword">true</span>) : this._rearrange(event, null, this.containers[innermostIndex].element, true); </div>
<div class="line"><a name="l03618"></a><span class="lineno"> 3618</span>&#160;            this._trigger(<span class="stringliteral">&quot;change&quot;</span>, event, this._uiHash()); </div>
<div class="line"><a name="l03619"></a><span class="lineno"> 3619</span>&#160;            this.containers[innermostIndex]._trigger(<span class="stringliteral">&quot;change&quot;</span>, event, this._uiHash(<span class="keyword">this</span>)); </div>
<div class="line"><a name="l03620"></a><span class="lineno"> 3620</span>&#160;</div>
<div class="line"><a name="l03621"></a><span class="lineno"> 3621</span>&#160;            <span class="comment">//Update the placeholder </span></div>
<div class="line"><a name="l03622"></a><span class="lineno"> 3622</span>&#160;            this.options.placeholder.update(this.currentContainer, this.placeholder); </div>
<div class="line"><a name="l03623"></a><span class="lineno"> 3623</span>&#160;        </div>
<div class="line"><a name="l03624"></a><span class="lineno"> 3624</span>&#160;            this.containers[innermostIndex]._trigger(<span class="stringliteral">&quot;over&quot;</span>, event, this._uiHash(<span class="keyword">this</span>)); </div>
<div class="line"><a name="l03625"></a><span class="lineno"> 3625</span>&#160;            this.containers[innermostIndex].containerCache.over = 1;</div>
<div class="line"><a name="l03626"></a><span class="lineno"> 3626</span>&#160;        } </div>
<div class="line"><a name="l03627"></a><span class="lineno"> 3627</span>&#160;    </div>
<div class="line"><a name="l03628"></a><span class="lineno"> 3628</span>&#160;        </div>
<div class="line"><a name="l03629"></a><span class="lineno"> 3629</span>&#160;    },</div>
<div class="line"><a name="l03630"></a><span class="lineno"> 3630</span>&#160;</div>
<div class="line"><a name="l03631"></a><span class="lineno"> 3631</span>&#160;    _createHelper: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l03632"></a><span class="lineno"> 3632</span>&#160;</div>
<div class="line"><a name="l03633"></a><span class="lineno"> 3633</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l03634"></a><span class="lineno"> 3634</span>&#160;        var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == <span class="stringliteral">&#39;clone&#39;</span> ? <span class="keyword">this</span>.currentItem.clone() : this.currentItem);</div>
<div class="line"><a name="l03635"></a><span class="lineno"> 3635</span>&#160;</div>
<div class="line"><a name="l03636"></a><span class="lineno"> 3636</span>&#160;        <span class="keywordflow">if</span>(!helper.parents(<span class="stringliteral">&#39;body&#39;</span>).length) <span class="comment">//Add the helper to the DOM if that didn&#39;t happen already</span></div>
<div class="line"><a name="l03637"></a><span class="lineno"> 3637</span>&#160;            $(o.appendTo != <span class="stringliteral">&#39;parent&#39;</span> ? o.appendTo : <span class="keyword">this</span>.currentItem[0].parentNode)[0].appendChild(helper[0]);</div>
<div class="line"><a name="l03638"></a><span class="lineno"> 3638</span>&#160;</div>
<div class="line"><a name="l03639"></a><span class="lineno"> 3639</span>&#160;        <span class="keywordflow">if</span>(helper[0] == this.currentItem[0])</div>
<div class="line"><a name="l03640"></a><span class="lineno"> 3640</span>&#160;            this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(<span class="stringliteral">&quot;position&quot;</span>), top: this.currentItem.css(<span class="stringliteral">&quot;top&quot;</span>), left: this.currentItem.css(<span class="stringliteral">&quot;left&quot;</span>) };</div>
<div class="line"><a name="l03641"></a><span class="lineno"> 3641</span>&#160;</div>
<div class="line"><a name="l03642"></a><span class="lineno"> 3642</span>&#160;        <span class="keywordflow">if</span>(helper[0].style.width == <span class="stringliteral">&#39;&#39;</span> || o.forceHelperSize) helper.width(this.currentItem.width());</div>
<div class="line"><a name="l03643"></a><span class="lineno"> 3643</span>&#160;        <span class="keywordflow">if</span>(helper[0].style.height == <span class="stringliteral">&#39;&#39;</span> || o.forceHelperSize) helper.height(this.currentItem.height());</div>
<div class="line"><a name="l03644"></a><span class="lineno"> 3644</span>&#160;</div>
<div class="line"><a name="l03645"></a><span class="lineno"> 3645</span>&#160;        <span class="keywordflow">return</span> helper;</div>
<div class="line"><a name="l03646"></a><span class="lineno"> 3646</span>&#160;</div>
<div class="line"><a name="l03647"></a><span class="lineno"> 3647</span>&#160;    },</div>
<div class="line"><a name="l03648"></a><span class="lineno"> 3648</span>&#160;</div>
<div class="line"><a name="l03649"></a><span class="lineno"> 3649</span>&#160;    _adjustOffsetFromHelper: <span class="keyword">function</span>(obj) {</div>
<div class="line"><a name="l03650"></a><span class="lineno"> 3650</span>&#160;        <span class="keywordflow">if</span> (typeof obj == <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l03651"></a><span class="lineno"> 3651</span>&#160;            obj = obj.split(<span class="charliteral">&#39; &#39;</span>);</div>
<div class="line"><a name="l03652"></a><span class="lineno"> 3652</span>&#160;        }</div>
<div class="line"><a name="l03653"></a><span class="lineno"> 3653</span>&#160;        <span class="keywordflow">if</span> ($.isArray(obj)) {</div>
<div class="line"><a name="l03654"></a><span class="lineno"> 3654</span>&#160;            obj = {left: +obj[0], top: +obj[1] || 0};</div>
<div class="line"><a name="l03655"></a><span class="lineno"> 3655</span>&#160;        }</div>
<div class="line"><a name="l03656"></a><span class="lineno"> 3656</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;left&#39;</span> in obj) {</div>
<div class="line"><a name="l03657"></a><span class="lineno"> 3657</span>&#160;            this.offset.click.left = obj.left + this.margins.left;</div>
<div class="line"><a name="l03658"></a><span class="lineno"> 3658</span>&#160;        }</div>
<div class="line"><a name="l03659"></a><span class="lineno"> 3659</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;right&#39;</span> in obj) {</div>
<div class="line"><a name="l03660"></a><span class="lineno"> 3660</span>&#160;            this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;</div>
<div class="line"><a name="l03661"></a><span class="lineno"> 3661</span>&#160;        }</div>
<div class="line"><a name="l03662"></a><span class="lineno"> 3662</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;top&#39;</span> in obj) {</div>
<div class="line"><a name="l03663"></a><span class="lineno"> 3663</span>&#160;            this.offset.click.top = obj.top + this.margins.top;</div>
<div class="line"><a name="l03664"></a><span class="lineno"> 3664</span>&#160;        }</div>
<div class="line"><a name="l03665"></a><span class="lineno"> 3665</span>&#160;        <span class="keywordflow">if</span> (<span class="stringliteral">&#39;bottom&#39;</span> in obj) {</div>
<div class="line"><a name="l03666"></a><span class="lineno"> 3666</span>&#160;            this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;</div>
<div class="line"><a name="l03667"></a><span class="lineno"> 3667</span>&#160;        }</div>
<div class="line"><a name="l03668"></a><span class="lineno"> 3668</span>&#160;    },</div>
<div class="line"><a name="l03669"></a><span class="lineno"> 3669</span>&#160;</div>
<div class="line"><a name="l03670"></a><span class="lineno"> 3670</span>&#160;    _getParentOffset: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03671"></a><span class="lineno"> 3671</span>&#160;</div>
<div class="line"><a name="l03672"></a><span class="lineno"> 3672</span>&#160;</div>
<div class="line"><a name="l03673"></a><span class="lineno"> 3673</span>&#160;        <span class="comment">//Get the offsetParent and cache its position</span></div>
<div class="line"><a name="l03674"></a><span class="lineno"> 3674</span>&#160;        this.offsetParent = this.helper.offsetParent();</div>
<div class="line"><a name="l03675"></a><span class="lineno"> 3675</span>&#160;        var po = this.offsetParent.offset();</div>
<div class="line"><a name="l03676"></a><span class="lineno"> 3676</span>&#160;</div>
<div class="line"><a name="l03677"></a><span class="lineno"> 3677</span>&#160;        <span class="comment">// This is a special case where we need to modify a offset calculated on start, since the following happened:</span></div>
<div class="line"><a name="l03678"></a><span class="lineno"> 3678</span>&#160;        <span class="comment">// 1. The position of the helper is absolute, so it&#39;s position is calculated based on the next positioned parent</span></div>
<div class="line"><a name="l03679"></a><span class="lineno"> 3679</span>&#160;        <span class="comment">// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn&#39;t the document, which means that</span></div>
<div class="line"><a name="l03680"></a><span class="lineno"> 3680</span>&#160;        <span class="comment">//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag</span></div>
<div class="line"><a name="l03681"></a><span class="lineno"> 3681</span>&#160;        <span class="keywordflow">if</span>(this.cssPosition == <span class="stringliteral">&#39;absolute&#39;</span> &amp;&amp; this.scrollParent[0] != document &amp;&amp; $.ui.contains(<span class="keyword">this</span>.scrollParent[0], <span class="keyword">this</span>.offsetParent[0])) {</div>
<div class="line"><a name="l03682"></a><span class="lineno"> 3682</span>&#160;            po.left += this.scrollParent.scrollLeft();</div>
<div class="line"><a name="l03683"></a><span class="lineno"> 3683</span>&#160;            po.top += this.scrollParent.scrollTop();</div>
<div class="line"><a name="l03684"></a><span class="lineno"> 3684</span>&#160;        }</div>
<div class="line"><a name="l03685"></a><span class="lineno"> 3685</span>&#160;</div>
<div class="line"><a name="l03686"></a><span class="lineno"> 3686</span>&#160;        <span class="keywordflow">if</span>((this.offsetParent[0] == document.body) <span class="comment">//This needs to be actually done for all browsers, since pageX/pageY includes this information</span></div>
<div class="line"><a name="l03687"></a><span class="lineno"> 3687</span>&#160;        || (<span class="keyword">this</span>.offsetParent[0].tagName &amp;&amp; <span class="keyword">this</span>.offsetParent[0].tagName.toLowerCase() == <span class="stringliteral">&#39;html&#39;</span> &amp;&amp; $.browser.msie)) <span class="comment">//Ugly IE fix</span></div>
<div class="line"><a name="l03688"></a><span class="lineno"> 3688</span>&#160;            po = { top: 0, left: 0 };</div>
<div class="line"><a name="l03689"></a><span class="lineno"> 3689</span>&#160;</div>
<div class="line"><a name="l03690"></a><span class="lineno"> 3690</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l03691"></a><span class="lineno"> 3691</span>&#160;            top: po.top + (parseInt(this.offsetParent.css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>),10) || 0),</div>
<div class="line"><a name="l03692"></a><span class="lineno"> 3692</span>&#160;            left: po.left + (parseInt(this.offsetParent.css(<span class="stringliteral">&quot;borderLeftWidth&quot;</span>),10) || 0)</div>
<div class="line"><a name="l03693"></a><span class="lineno"> 3693</span>&#160;        };</div>
<div class="line"><a name="l03694"></a><span class="lineno"> 3694</span>&#160;</div>
<div class="line"><a name="l03695"></a><span class="lineno"> 3695</span>&#160;    },</div>
<div class="line"><a name="l03696"></a><span class="lineno"> 3696</span>&#160;</div>
<div class="line"><a name="l03697"></a><span class="lineno"> 3697</span>&#160;    _getRelativeOffset: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03698"></a><span class="lineno"> 3698</span>&#160;</div>
<div class="line"><a name="l03699"></a><span class="lineno"> 3699</span>&#160;        <span class="keywordflow">if</span>(this.cssPosition == <span class="stringliteral">&quot;relative&quot;</span>) {</div>
<div class="line"><a name="l03700"></a><span class="lineno"> 3700</span>&#160;            var p = this.currentItem.position();</div>
<div class="line"><a name="l03701"></a><span class="lineno"> 3701</span>&#160;            <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l03702"></a><span class="lineno"> 3702</span>&#160;                top: p.top - (parseInt(this.helper.css(<span class="stringliteral">&quot;top&quot;</span>),10) || 0) + this.scrollParent.scrollTop(),</div>
<div class="line"><a name="l03703"></a><span class="lineno"> 3703</span>&#160;                left: p.left - (parseInt(this.helper.css(<span class="stringliteral">&quot;left&quot;</span>),10) || 0) + this.scrollParent.scrollLeft()</div>
<div class="line"><a name="l03704"></a><span class="lineno"> 3704</span>&#160;            };</div>
<div class="line"><a name="l03705"></a><span class="lineno"> 3705</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03706"></a><span class="lineno"> 3706</span>&#160;            <span class="keywordflow">return</span> { top: 0, left: 0 };</div>
<div class="line"><a name="l03707"></a><span class="lineno"> 3707</span>&#160;        }</div>
<div class="line"><a name="l03708"></a><span class="lineno"> 3708</span>&#160;</div>
<div class="line"><a name="l03709"></a><span class="lineno"> 3709</span>&#160;    },</div>
<div class="line"><a name="l03710"></a><span class="lineno"> 3710</span>&#160;</div>
<div class="line"><a name="l03711"></a><span class="lineno"> 3711</span>&#160;    _cacheMargins: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03712"></a><span class="lineno"> 3712</span>&#160;        this.margins = {</div>
<div class="line"><a name="l03713"></a><span class="lineno"> 3713</span>&#160;            left: (parseInt(this.currentItem.css(<span class="stringliteral">&quot;marginLeft&quot;</span>),10) || 0),</div>
<div class="line"><a name="l03714"></a><span class="lineno"> 3714</span>&#160;            top: (parseInt(this.currentItem.css(<span class="stringliteral">&quot;marginTop&quot;</span>),10) || 0)</div>
<div class="line"><a name="l03715"></a><span class="lineno"> 3715</span>&#160;        };</div>
<div class="line"><a name="l03716"></a><span class="lineno"> 3716</span>&#160;    },</div>
<div class="line"><a name="l03717"></a><span class="lineno"> 3717</span>&#160;</div>
<div class="line"><a name="l03718"></a><span class="lineno"> 3718</span>&#160;    _cacheHelperProportions: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03719"></a><span class="lineno"> 3719</span>&#160;        this.helperProportions = {</div>
<div class="line"><a name="l03720"></a><span class="lineno"> 3720</span>&#160;            width: this.helper.outerWidth(),</div>
<div class="line"><a name="l03721"></a><span class="lineno"> 3721</span>&#160;            height: this.helper.outerHeight()</div>
<div class="line"><a name="l03722"></a><span class="lineno"> 3722</span>&#160;        };</div>
<div class="line"><a name="l03723"></a><span class="lineno"> 3723</span>&#160;    },</div>
<div class="line"><a name="l03724"></a><span class="lineno"> 3724</span>&#160;</div>
<div class="line"><a name="l03725"></a><span class="lineno"> 3725</span>&#160;    _setContainment: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03726"></a><span class="lineno"> 3726</span>&#160;</div>
<div class="line"><a name="l03727"></a><span class="lineno"> 3727</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l03728"></a><span class="lineno"> 3728</span>&#160;        <span class="keywordflow">if</span>(o.containment == <span class="stringliteral">&#39;parent&#39;</span>) o.containment = this.helper[0].parentNode;</div>
<div class="line"><a name="l03729"></a><span class="lineno"> 3729</span>&#160;        <span class="keywordflow">if</span>(o.containment == <span class="stringliteral">&#39;document&#39;</span> || o.containment == <span class="stringliteral">&#39;window&#39;</span>) this.containment = [</div>
<div class="line"><a name="l03730"></a><span class="lineno"> 3730</span>&#160;            0 - this.offset.relative.left - this.offset.parent.left,</div>
<div class="line"><a name="l03731"></a><span class="lineno"> 3731</span>&#160;            0 - this.offset.relative.top - this.offset.parent.top,</div>
<div class="line"><a name="l03732"></a><span class="lineno"> 3732</span>&#160;            $(o.containment == <span class="stringliteral">&#39;document&#39;</span> ? document : window).width() - this.helperProportions.width - this.margins.left,</div>
<div class="line"><a name="l03733"></a><span class="lineno"> 3733</span>&#160;            ($(o.containment == <span class="stringliteral">&#39;document&#39;</span> ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - <span class="keyword">this</span>.margins.top</div>
<div class="line"><a name="l03734"></a><span class="lineno"> 3734</span>&#160;        ];</div>
<div class="line"><a name="l03735"></a><span class="lineno"> 3735</span>&#160;</div>
<div class="line"><a name="l03736"></a><span class="lineno"> 3736</span>&#160;        <span class="keywordflow">if</span>(!(/^(document|window|parent)$/).test(o.containment)) {</div>
<div class="line"><a name="l03737"></a><span class="lineno"> 3737</span>&#160;            var ce = $(o.containment)[0];</div>
<div class="line"><a name="l03738"></a><span class="lineno"> 3738</span>&#160;            var co = $(o.containment).offset();</div>
<div class="line"><a name="l03739"></a><span class="lineno"> 3739</span>&#160;            var over = ($(ce).css(<span class="stringliteral">&quot;overflow&quot;</span>) != <span class="stringliteral">&#39;hidden&#39;</span>);</div>
<div class="line"><a name="l03740"></a><span class="lineno"> 3740</span>&#160;</div>
<div class="line"><a name="l03741"></a><span class="lineno"> 3741</span>&#160;            this.containment = [</div>
<div class="line"><a name="l03742"></a><span class="lineno"> 3742</span>&#160;                co.left + (parseInt($(ce).css(<span class="stringliteral">&quot;borderLeftWidth&quot;</span>),10) || 0) + (parseInt($(ce).css(<span class="stringliteral">&quot;paddingLeft&quot;</span>),10) || 0) - this.margins.left,</div>
<div class="line"><a name="l03743"></a><span class="lineno"> 3743</span>&#160;                co.top + (parseInt($(ce).css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>),10) || 0) + (parseInt($(ce).css(<span class="stringliteral">&quot;paddingTop&quot;</span>),10) || 0) - this.margins.top,</div>
<div class="line"><a name="l03744"></a><span class="lineno"> 3744</span>&#160;                co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(<span class="stringliteral">&quot;borderLeftWidth&quot;</span>),10) || 0) - (parseInt($(ce).css(<span class="stringliteral">&quot;paddingRight&quot;</span>),10) || 0) - this.helperProportions.width - <span class="keyword">this</span>.margins.left,</div>
<div class="line"><a name="l03745"></a><span class="lineno"> 3745</span>&#160;                co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>),10) || 0) - (parseInt($(ce).css(<span class="stringliteral">&quot;paddingBottom&quot;</span>),10) || 0) - this.helperProportions.height - <span class="keyword">this</span>.margins.top</div>
<div class="line"><a name="l03746"></a><span class="lineno"> 3746</span>&#160;            ];</div>
<div class="line"><a name="l03747"></a><span class="lineno"> 3747</span>&#160;        }</div>
<div class="line"><a name="l03748"></a><span class="lineno"> 3748</span>&#160;</div>
<div class="line"><a name="l03749"></a><span class="lineno"> 3749</span>&#160;    },</div>
<div class="line"><a name="l03750"></a><span class="lineno"> 3750</span>&#160;</div>
<div class="line"><a name="l03751"></a><span class="lineno"> 3751</span>&#160;    _convertPositionTo: <span class="keyword">function</span>(d, pos) {</div>
<div class="line"><a name="l03752"></a><span class="lineno"> 3752</span>&#160;</div>
<div class="line"><a name="l03753"></a><span class="lineno"> 3753</span>&#160;        <span class="keywordflow">if</span>(!pos) pos = this.position;</div>
<div class="line"><a name="l03754"></a><span class="lineno"> 3754</span>&#160;        var mod = d == <span class="stringliteral">&quot;absolute&quot;</span> ? 1 : -1;</div>
<div class="line"><a name="l03755"></a><span class="lineno"> 3755</span>&#160;        var o = this.options, scroll = this.cssPosition == <span class="stringliteral">&#39;absolute&#39;</span> &amp;&amp; !(this.scrollParent[0] != document &amp;&amp; $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);</div>
<div class="line"><a name="l03756"></a><span class="lineno"> 3756</span>&#160;</div>
<div class="line"><a name="l03757"></a><span class="lineno"> 3757</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l03758"></a><span class="lineno"> 3758</span>&#160;            top: (</div>
<div class="line"><a name="l03759"></a><span class="lineno"> 3759</span>&#160;                pos.top                                                                 <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l03760"></a><span class="lineno"> 3760</span>&#160;                + this.offset.relative.top * mod                                        <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l03761"></a><span class="lineno"> 3761</span>&#160;                + this.offset.parent.top * mod                                          <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l03762"></a><span class="lineno"> 3762</span>&#160;                - ($.browser.safari &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)</div>
<div class="line"><a name="l03763"></a><span class="lineno"> 3763</span>&#160;            ),</div>
<div class="line"><a name="l03764"></a><span class="lineno"> 3764</span>&#160;            left: (</div>
<div class="line"><a name="l03765"></a><span class="lineno"> 3765</span>&#160;                pos.left                                                                <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l03766"></a><span class="lineno"> 3766</span>&#160;                + this.offset.relative.left * mod                                       <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l03767"></a><span class="lineno"> 3767</span>&#160;                + this.offset.parent.left * mod                                         <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l03768"></a><span class="lineno"> 3768</span>&#160;                - ($.browser.safari &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)</div>
<div class="line"><a name="l03769"></a><span class="lineno"> 3769</span>&#160;            )</div>
<div class="line"><a name="l03770"></a><span class="lineno"> 3770</span>&#160;        };</div>
<div class="line"><a name="l03771"></a><span class="lineno"> 3771</span>&#160;</div>
<div class="line"><a name="l03772"></a><span class="lineno"> 3772</span>&#160;    },</div>
<div class="line"><a name="l03773"></a><span class="lineno"> 3773</span>&#160;</div>
<div class="line"><a name="l03774"></a><span class="lineno"> 3774</span>&#160;    _generatePosition: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l03775"></a><span class="lineno"> 3775</span>&#160;</div>
<div class="line"><a name="l03776"></a><span class="lineno"> 3776</span>&#160;        var o = this.options, scroll = this.cssPosition == <span class="stringliteral">&#39;absolute&#39;</span> &amp;&amp; !(this.scrollParent[0] != document &amp;&amp; $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);</div>
<div class="line"><a name="l03777"></a><span class="lineno"> 3777</span>&#160;</div>
<div class="line"><a name="l03778"></a><span class="lineno"> 3778</span>&#160;        <span class="comment">// This is another very weird special case that only happens for relative elements:</span></div>
<div class="line"><a name="l03779"></a><span class="lineno"> 3779</span>&#160;        <span class="comment">// 1. If the css position is relative</span></div>
<div class="line"><a name="l03780"></a><span class="lineno"> 3780</span>&#160;        <span class="comment">// 2. and the scroll parent is the document or similar to the offset parent</span></div>
<div class="line"><a name="l03781"></a><span class="lineno"> 3781</span>&#160;        <span class="comment">// we have to refresh the relative offset during the scroll so there are no jumps</span></div>
<div class="line"><a name="l03782"></a><span class="lineno"> 3782</span>&#160;        <span class="keywordflow">if</span>(this.cssPosition == <span class="stringliteral">&#39;relative&#39;</span> &amp;&amp; !(this.scrollParent[0] != document &amp;&amp; this.scrollParent[0] != this.offsetParent[0])) {</div>
<div class="line"><a name="l03783"></a><span class="lineno"> 3783</span>&#160;            this.offset.relative = this._getRelativeOffset();</div>
<div class="line"><a name="l03784"></a><span class="lineno"> 3784</span>&#160;        }</div>
<div class="line"><a name="l03785"></a><span class="lineno"> 3785</span>&#160;</div>
<div class="line"><a name="l03786"></a><span class="lineno"> 3786</span>&#160;        var pageX = <span class="keyword">event</span>.pageX;</div>
<div class="line"><a name="l03787"></a><span class="lineno"> 3787</span>&#160;        var pageY = <span class="keyword">event</span>.pageY;</div>
<div class="line"><a name="l03788"></a><span class="lineno"> 3788</span>&#160;</div>
<div class="line"><a name="l03789"></a><span class="lineno"> 3789</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03790"></a><span class="lineno"> 3790</span>&#160;<span class="comment">         * - Position constraining -</span></div>
<div class="line"><a name="l03791"></a><span class="lineno"> 3791</span>&#160;<span class="comment">         * Constrain the position to a mix of grid, containment.</span></div>
<div class="line"><a name="l03792"></a><span class="lineno"> 3792</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03793"></a><span class="lineno"> 3793</span>&#160;</div>
<div class="line"><a name="l03794"></a><span class="lineno"> 3794</span>&#160;        <span class="keywordflow">if</span>(this.originalPosition) { <span class="comment">//If we are not dragging yet, we won&#39;t check for options</span></div>
<div class="line"><a name="l03795"></a><span class="lineno"> 3795</span>&#160;</div>
<div class="line"><a name="l03796"></a><span class="lineno"> 3796</span>&#160;            <span class="keywordflow">if</span>(this.containment) {</div>
<div class="line"><a name="l03797"></a><span class="lineno"> 3797</span>&#160;                <span class="keywordflow">if</span>(event.pageX - <span class="keyword">this</span>.offset.click.left &lt; <span class="keyword">this</span>.containment[0]) pageX = this.containment[0] + this.offset.click.left;</div>
<div class="line"><a name="l03798"></a><span class="lineno"> 3798</span>&#160;                <span class="keywordflow">if</span>(event.pageY - <span class="keyword">this</span>.offset.click.top &lt; <span class="keyword">this</span>.containment[1]) pageY = this.containment[1] + this.offset.click.top;</div>
<div class="line"><a name="l03799"></a><span class="lineno"> 3799</span>&#160;                <span class="keywordflow">if</span>(event.pageX - <span class="keyword">this</span>.offset.click.left &gt; <span class="keyword">this</span>.containment[2]) pageX = this.containment[2] + this.offset.click.left;</div>
<div class="line"><a name="l03800"></a><span class="lineno"> 3800</span>&#160;                <span class="keywordflow">if</span>(event.pageY - <span class="keyword">this</span>.offset.click.top &gt; <span class="keyword">this</span>.containment[3]) pageY = this.containment[3] + this.offset.click.top;</div>
<div class="line"><a name="l03801"></a><span class="lineno"> 3801</span>&#160;            }</div>
<div class="line"><a name="l03802"></a><span class="lineno"> 3802</span>&#160;</div>
<div class="line"><a name="l03803"></a><span class="lineno"> 3803</span>&#160;            <span class="keywordflow">if</span>(o.grid) {</div>
<div class="line"><a name="l03804"></a><span class="lineno"> 3804</span>&#160;                var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];</div>
<div class="line"><a name="l03805"></a><span class="lineno"> 3805</span>&#160;                pageY = this.containment ? (!(top - this.offset.click.top &lt; this.containment[1] || top - this.offset.click.top &gt; this.containment[3]) ? top : (!(top - this.offset.click.top &lt; <span class="keyword">this</span>.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;</div>
<div class="line"><a name="l03806"></a><span class="lineno"> 3806</span>&#160;</div>
<div class="line"><a name="l03807"></a><span class="lineno"> 3807</span>&#160;                var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];</div>
<div class="line"><a name="l03808"></a><span class="lineno"> 3808</span>&#160;                pageX = this.containment ? (!(left - this.offset.click.left &lt; this.containment[0] || left - this.offset.click.left &gt; this.containment[2]) ? left : (!(left - this.offset.click.left &lt; <span class="keyword">this</span>.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;</div>
<div class="line"><a name="l03809"></a><span class="lineno"> 3809</span>&#160;            }</div>
<div class="line"><a name="l03810"></a><span class="lineno"> 3810</span>&#160;</div>
<div class="line"><a name="l03811"></a><span class="lineno"> 3811</span>&#160;        }</div>
<div class="line"><a name="l03812"></a><span class="lineno"> 3812</span>&#160;</div>
<div class="line"><a name="l03813"></a><span class="lineno"> 3813</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l03814"></a><span class="lineno"> 3814</span>&#160;            top: (</div>
<div class="line"><a name="l03815"></a><span class="lineno"> 3815</span>&#160;                pageY                                                               <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l03816"></a><span class="lineno"> 3816</span>&#160;                - this.offset.click.top                                                 <span class="comment">// Click offset (relative to the element)</span></div>
<div class="line"><a name="l03817"></a><span class="lineno"> 3817</span>&#160;                - this.offset.relative.top                                              <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l03818"></a><span class="lineno"> 3818</span>&#160;                - this.offset.parent.top                                                <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l03819"></a><span class="lineno"> 3819</span>&#160;                + ($.browser.safari &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))</div>
<div class="line"><a name="l03820"></a><span class="lineno"> 3820</span>&#160;            ),</div>
<div class="line"><a name="l03821"></a><span class="lineno"> 3821</span>&#160;            left: (</div>
<div class="line"><a name="l03822"></a><span class="lineno"> 3822</span>&#160;                pageX                                                               <span class="comment">// The absolute mouse position</span></div>
<div class="line"><a name="l03823"></a><span class="lineno"> 3823</span>&#160;                - this.offset.click.left                                                <span class="comment">// Click offset (relative to the element)</span></div>
<div class="line"><a name="l03824"></a><span class="lineno"> 3824</span>&#160;                - this.offset.relative.left                                             <span class="comment">// Only for relative positioned nodes: Relative offset from element to offset parent</span></div>
<div class="line"><a name="l03825"></a><span class="lineno"> 3825</span>&#160;                - this.offset.parent.left                                               <span class="comment">// The offsetParent&#39;s offset without borders (offset + border)</span></div>
<div class="line"><a name="l03826"></a><span class="lineno"> 3826</span>&#160;                + ($.browser.safari &amp;&amp; this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? 0 : ( this.cssPosition == <span class="stringliteral">&#39;fixed&#39;</span> ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))</div>
<div class="line"><a name="l03827"></a><span class="lineno"> 3827</span>&#160;            )</div>
<div class="line"><a name="l03828"></a><span class="lineno"> 3828</span>&#160;        };</div>
<div class="line"><a name="l03829"></a><span class="lineno"> 3829</span>&#160;</div>
<div class="line"><a name="l03830"></a><span class="lineno"> 3830</span>&#160;    },</div>
<div class="line"><a name="l03831"></a><span class="lineno"> 3831</span>&#160;</div>
<div class="line"><a name="l03832"></a><span class="lineno"> 3832</span>&#160;    _rearrange: <span class="keyword">function</span>(event, i, a, hardRefresh) {</div>
<div class="line"><a name="l03833"></a><span class="lineno"> 3833</span>&#160;</div>
<div class="line"><a name="l03834"></a><span class="lineno"> 3834</span>&#160;        a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == <span class="stringliteral">&#39;down&#39;</span> ? i.item[0] : i.item[0].nextSibling));</div>
<div class="line"><a name="l03835"></a><span class="lineno"> 3835</span>&#160;</div>
<div class="line"><a name="l03836"></a><span class="lineno"> 3836</span>&#160;        <span class="comment">//Various things done here to improve the performance:</span></div>
<div class="line"><a name="l03837"></a><span class="lineno"> 3837</span>&#160;        <span class="comment">// 1. we create a setTimeout, that calls refreshPositions</span></div>
<div class="line"><a name="l03838"></a><span class="lineno"> 3838</span>&#160;        <span class="comment">// 2. on the instance, we have a counter variable, that get&#39;s higher after every append</span></div>
<div class="line"><a name="l03839"></a><span class="lineno"> 3839</span>&#160;        <span class="comment">// 3. on the local scope, we copy the counter variable, and check in the timeout, if it&#39;s still the same</span></div>
<div class="line"><a name="l03840"></a><span class="lineno"> 3840</span>&#160;        <span class="comment">// 4. this lets only the last addition to the timeout stack through</span></div>
<div class="line"><a name="l03841"></a><span class="lineno"> 3841</span>&#160;        this.counter = this.counter ? ++this.counter : 1;</div>
<div class="line"><a name="l03842"></a><span class="lineno"> 3842</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>, counter = this.counter;</div>
<div class="line"><a name="l03843"></a><span class="lineno"> 3843</span>&#160;</div>
<div class="line"><a name="l03844"></a><span class="lineno"> 3844</span>&#160;        window.setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l03845"></a><span class="lineno"> 3845</span>&#160;            <span class="keywordflow">if</span>(counter == <span class="keyword">self</span>.counter) <span class="keyword">self</span>.refreshPositions(!hardRefresh); <span class="comment">//Precompute after each DOM insertion, NOT on mousemove</span></div>
<div class="line"><a name="l03846"></a><span class="lineno"> 3846</span>&#160;        },0);</div>
<div class="line"><a name="l03847"></a><span class="lineno"> 3847</span>&#160;</div>
<div class="line"><a name="l03848"></a><span class="lineno"> 3848</span>&#160;    },</div>
<div class="line"><a name="l03849"></a><span class="lineno"> 3849</span>&#160;</div>
<div class="line"><a name="l03850"></a><span class="lineno"> 3850</span>&#160;    _clear: <span class="keyword">function</span>(event, noPropagation) {</div>
<div class="line"><a name="l03851"></a><span class="lineno"> 3851</span>&#160;</div>
<div class="line"><a name="l03852"></a><span class="lineno"> 3852</span>&#160;        this.reverting = <span class="keyword">false</span>;</div>
<div class="line"><a name="l03853"></a><span class="lineno"> 3853</span>&#160;        <span class="comment">// We delay all events that have to be triggered to after the point where the placeholder has been removed and</span></div>
<div class="line"><a name="l03854"></a><span class="lineno"> 3854</span>&#160;        <span class="comment">// everything else normalized again</span></div>
<div class="line"><a name="l03855"></a><span class="lineno"> 3855</span>&#160;        var delayedTriggers = [], <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l03856"></a><span class="lineno"> 3856</span>&#160;</div>
<div class="line"><a name="l03857"></a><span class="lineno"> 3857</span>&#160;        <span class="comment">// We first have to update the dom position of the actual currentItem</span></div>
<div class="line"><a name="l03858"></a><span class="lineno"> 3858</span>&#160;        <span class="comment">// Note: don&#39;t do it if the current item is already removed (by a user), or it gets reappended (see #4088)</span></div>
<div class="line"><a name="l03859"></a><span class="lineno"> 3859</span>&#160;        <span class="keywordflow">if</span>(!this._noFinalSort &amp;&amp; this.currentItem.parent().length) this.placeholder.before(<span class="keyword">this</span>.currentItem);</div>
<div class="line"><a name="l03860"></a><span class="lineno"> 3860</span>&#160;        this._noFinalSort = null;</div>
<div class="line"><a name="l03861"></a><span class="lineno"> 3861</span>&#160;</div>
<div class="line"><a name="l03862"></a><span class="lineno"> 3862</span>&#160;        <span class="keywordflow">if</span>(this.helper[0] == this.currentItem[0]) {</div>
<div class="line"><a name="l03863"></a><span class="lineno"> 3863</span>&#160;            <span class="keywordflow">for</span>(var i in this._storedCSS) {</div>
<div class="line"><a name="l03864"></a><span class="lineno"> 3864</span>&#160;                <span class="keywordflow">if</span>(this._storedCSS[i] == <span class="stringliteral">&#39;auto&#39;</span> || this._storedCSS[i] == <span class="stringliteral">&#39;static&#39;</span>) this._storedCSS[i] = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l03865"></a><span class="lineno"> 3865</span>&#160;            }</div>
<div class="line"><a name="l03866"></a><span class="lineno"> 3866</span>&#160;            this.currentItem.css(this._storedCSS).removeClass(<span class="stringliteral">&quot;ui-sortable-helper&quot;</span>);</div>
<div class="line"><a name="l03867"></a><span class="lineno"> 3867</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03868"></a><span class="lineno"> 3868</span>&#160;            this.currentItem.show();</div>
<div class="line"><a name="l03869"></a><span class="lineno"> 3869</span>&#160;        }</div>
<div class="line"><a name="l03870"></a><span class="lineno"> 3870</span>&#160;</div>
<div class="line"><a name="l03871"></a><span class="lineno"> 3871</span>&#160;        <span class="keywordflow">if</span>(this.fromOutside &amp;&amp; !noPropagation) delayedTriggers.push(<span class="keyword">function</span>(event) { this._trigger(<span class="stringliteral">&quot;receive&quot;</span>, event, this._uiHash(this.fromOutside)); });</div>
<div class="line"><a name="l03872"></a><span class="lineno"> 3872</span>&#160;        <span class="keywordflow">if</span>((this.fromOutside || this.domPosition.prev != <span class="keyword">this</span>.currentItem.prev().not(<span class="stringliteral">&quot;.ui-sortable-helper&quot;</span>)[0] || this.domPosition.parent != this.currentItem.parent()[0]) &amp;&amp; !noPropagation) delayedTriggers.push(<span class="keyword">function</span>(event) { this._trigger(<span class="stringliteral">&quot;update&quot;</span>, event, this._uiHash()); }); <span class="comment">//Trigger update callback if the DOM position has changed</span></div>
<div class="line"><a name="l03873"></a><span class="lineno"> 3873</span>&#160;        <span class="keywordflow">if</span>(!$.ui.contains(<span class="keyword">this</span>.element[0], <span class="keyword">this</span>.currentItem[0])) { <span class="comment">//Node was moved out of the current element</span></div>
<div class="line"><a name="l03874"></a><span class="lineno"> 3874</span>&#160;            <span class="keywordflow">if</span>(!noPropagation) delayedTriggers.push(<span class="keyword">function</span>(event) { this._trigger(<span class="stringliteral">&quot;remove&quot;</span>, event, this._uiHash()); });</div>
<div class="line"><a name="l03875"></a><span class="lineno"> 3875</span>&#160;            <span class="keywordflow">for</span> (var i = this.containers.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03876"></a><span class="lineno"> 3876</span>&#160;                <span class="keywordflow">if</span>($.ui.contains(<span class="keyword">this</span>.containers[i].element[0], <span class="keyword">this</span>.currentItem[0]) &amp;&amp; !noPropagation) {</div>
<div class="line"><a name="l03877"></a><span class="lineno"> 3877</span>&#160;                    delayedTriggers.push((<span class="keyword">function</span>(c) { <span class="keywordflow">return</span> <span class="keyword">function</span>(event) { c._trigger(<span class="stringliteral">&quot;receive&quot;</span>, event, this._uiHash(<span class="keyword">this</span>)); };  }).call(<span class="keyword">this</span>, this.containers[i]));</div>
<div class="line"><a name="l03878"></a><span class="lineno"> 3878</span>&#160;                    delayedTriggers.push((<span class="keyword">function</span>(c) { <span class="keywordflow">return</span> <span class="keyword">function</span>(event) { c._trigger(<span class="stringliteral">&quot;update&quot;</span>, event, this._uiHash(<span class="keyword">this</span>));  }; }).call(<span class="keyword">this</span>, this.containers[i]));</div>
<div class="line"><a name="l03879"></a><span class="lineno"> 3879</span>&#160;                }</div>
<div class="line"><a name="l03880"></a><span class="lineno"> 3880</span>&#160;            };</div>
<div class="line"><a name="l03881"></a><span class="lineno"> 3881</span>&#160;        };</div>
<div class="line"><a name="l03882"></a><span class="lineno"> 3882</span>&#160;</div>
<div class="line"><a name="l03883"></a><span class="lineno"> 3883</span>&#160;        <span class="comment">//Post events to containers</span></div>
<div class="line"><a name="l03884"></a><span class="lineno"> 3884</span>&#160;        <span class="keywordflow">for</span> (var i = this.containers.length - 1; i &gt;= 0; i--){</div>
<div class="line"><a name="l03885"></a><span class="lineno"> 3885</span>&#160;            <span class="keywordflow">if</span>(!noPropagation) delayedTriggers.push((<span class="keyword">function</span>(c) { <span class="keywordflow">return</span> <span class="keyword">function</span>(event) { c._trigger(<span class="stringliteral">&quot;deactivate&quot;</span>, event, this._uiHash(<span class="keyword">this</span>)); };  }).call(<span class="keyword">this</span>, this.containers[i]));</div>
<div class="line"><a name="l03886"></a><span class="lineno"> 3886</span>&#160;            <span class="keywordflow">if</span>(this.containers[i].containerCache.over) {</div>
<div class="line"><a name="l03887"></a><span class="lineno"> 3887</span>&#160;                delayedTriggers.push((<span class="keyword">function</span>(c) { <span class="keywordflow">return</span> <span class="keyword">function</span>(event) { c._trigger(<span class="stringliteral">&quot;out&quot;</span>, event, this._uiHash(<span class="keyword">this</span>)); };  }).call(<span class="keyword">this</span>, this.containers[i]));</div>
<div class="line"><a name="l03888"></a><span class="lineno"> 3888</span>&#160;                this.containers[i].containerCache.over = 0;</div>
<div class="line"><a name="l03889"></a><span class="lineno"> 3889</span>&#160;            }</div>
<div class="line"><a name="l03890"></a><span class="lineno"> 3890</span>&#160;        }</div>
<div class="line"><a name="l03891"></a><span class="lineno"> 3891</span>&#160;</div>
<div class="line"><a name="l03892"></a><span class="lineno"> 3892</span>&#160;        <span class="comment">//Do what was originally in plugins</span></div>
<div class="line"><a name="l03893"></a><span class="lineno"> 3893</span>&#160;        <span class="keywordflow">if</span>(this._storedCursor) $(<span class="stringliteral">&#39;body&#39;</span>).css(<span class="stringliteral">&quot;cursor&quot;</span>, this._storedCursor); <span class="comment">//Reset cursor</span></div>
<div class="line"><a name="l03894"></a><span class="lineno"> 3894</span>&#160;        <span class="keywordflow">if</span>(this._storedOpacity) this.helper.css(<span class="stringliteral">&quot;opacity&quot;</span>, this._storedOpacity); <span class="comment">//Reset opacity</span></div>
<div class="line"><a name="l03895"></a><span class="lineno"> 3895</span>&#160;        <span class="keywordflow">if</span>(this._storedZIndex) this.helper.css(<span class="stringliteral">&quot;zIndex&quot;</span>, this._storedZIndex == <span class="stringliteral">&#39;auto&#39;</span> ? <span class="stringliteral">&#39;&#39;</span> : this._storedZIndex); <span class="comment">//Reset z-index</span></div>
<div class="line"><a name="l03896"></a><span class="lineno"> 3896</span>&#160;</div>
<div class="line"><a name="l03897"></a><span class="lineno"> 3897</span>&#160;        this.dragging = <span class="keyword">false</span>;</div>
<div class="line"><a name="l03898"></a><span class="lineno"> 3898</span>&#160;        <span class="keywordflow">if</span>(this.cancelHelperRemoval) {</div>
<div class="line"><a name="l03899"></a><span class="lineno"> 3899</span>&#160;            <span class="keywordflow">if</span>(!noPropagation) {</div>
<div class="line"><a name="l03900"></a><span class="lineno"> 3900</span>&#160;                this._trigger(<span class="stringliteral">&quot;beforeStop&quot;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03901"></a><span class="lineno"> 3901</span>&#160;                <span class="keywordflow">for</span> (var i=0; i &lt; delayedTriggers.length; i++) { delayedTriggers[i].call(<span class="keyword">this</span>, event); }; <span class="comment">//Trigger all delayed events</span></div>
<div class="line"><a name="l03902"></a><span class="lineno"> 3902</span>&#160;                this._trigger(<span class="stringliteral">&quot;stop&quot;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03903"></a><span class="lineno"> 3903</span>&#160;            }</div>
<div class="line"><a name="l03904"></a><span class="lineno"> 3904</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l03905"></a><span class="lineno"> 3905</span>&#160;        }</div>
<div class="line"><a name="l03906"></a><span class="lineno"> 3906</span>&#160;</div>
<div class="line"><a name="l03907"></a><span class="lineno"> 3907</span>&#160;        <span class="keywordflow">if</span>(!noPropagation) this._trigger(<span class="stringliteral">&quot;beforeStop&quot;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03908"></a><span class="lineno"> 3908</span>&#160;</div>
<div class="line"><a name="l03909"></a><span class="lineno"> 3909</span>&#160;        <span class="comment">//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!</span></div>
<div class="line"><a name="l03910"></a><span class="lineno"> 3910</span>&#160;        this.placeholder[0].parentNode.removeChild(this.placeholder[0]);</div>
<div class="line"><a name="l03911"></a><span class="lineno"> 3911</span>&#160;</div>
<div class="line"><a name="l03912"></a><span class="lineno"> 3912</span>&#160;        <span class="keywordflow">if</span>(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;</div>
<div class="line"><a name="l03913"></a><span class="lineno"> 3913</span>&#160;</div>
<div class="line"><a name="l03914"></a><span class="lineno"> 3914</span>&#160;        <span class="keywordflow">if</span>(!noPropagation) {</div>
<div class="line"><a name="l03915"></a><span class="lineno"> 3915</span>&#160;            <span class="keywordflow">for</span> (var i=0; i &lt; delayedTriggers.length; i++) { delayedTriggers[i].call(<span class="keyword">this</span>, event); }; <span class="comment">//Trigger all delayed events</span></div>
<div class="line"><a name="l03916"></a><span class="lineno"> 3916</span>&#160;            this._trigger(<span class="stringliteral">&quot;stop&quot;</span>, event, this._uiHash());</div>
<div class="line"><a name="l03917"></a><span class="lineno"> 3917</span>&#160;        }</div>
<div class="line"><a name="l03918"></a><span class="lineno"> 3918</span>&#160;</div>
<div class="line"><a name="l03919"></a><span class="lineno"> 3919</span>&#160;        this.fromOutside = <span class="keyword">false</span>;</div>
<div class="line"><a name="l03920"></a><span class="lineno"> 3920</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l03921"></a><span class="lineno"> 3921</span>&#160;</div>
<div class="line"><a name="l03922"></a><span class="lineno"> 3922</span>&#160;    },</div>
<div class="line"><a name="l03923"></a><span class="lineno"> 3923</span>&#160;</div>
<div class="line"><a name="l03924"></a><span class="lineno"> 3924</span>&#160;    _trigger: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l03925"></a><span class="lineno"> 3925</span>&#160;        <span class="keywordflow">if</span> ($.Widget.prototype._trigger.apply(<span class="keyword">this</span>, arguments) === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l03926"></a><span class="lineno"> 3926</span>&#160;            this.cancel();</div>
<div class="line"><a name="l03927"></a><span class="lineno"> 3927</span>&#160;        }</div>
<div class="line"><a name="l03928"></a><span class="lineno"> 3928</span>&#160;    },</div>
<div class="line"><a name="l03929"></a><span class="lineno"> 3929</span>&#160;</div>
<div class="line"><a name="l03930"></a><span class="lineno"> 3930</span>&#160;    _uiHash: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l03931"></a><span class="lineno"> 3931</span>&#160;        var <span class="keyword">self</span> = inst || <span class="keyword">this</span>;</div>
<div class="line"><a name="l03932"></a><span class="lineno"> 3932</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l03933"></a><span class="lineno"> 3933</span>&#160;            helper: <span class="keyword">self</span>.helper,</div>
<div class="line"><a name="l03934"></a><span class="lineno"> 3934</span>&#160;            placeholder: <span class="keyword">self</span>.placeholder || $([]),</div>
<div class="line"><a name="l03935"></a><span class="lineno"> 3935</span>&#160;            position: <span class="keyword">self</span>.position,</div>
<div class="line"><a name="l03936"></a><span class="lineno"> 3936</span>&#160;            originalPosition: <span class="keyword">self</span>.originalPosition,</div>
<div class="line"><a name="l03937"></a><span class="lineno"> 3937</span>&#160;            offset: <span class="keyword">self</span>.positionAbs,</div>
<div class="line"><a name="l03938"></a><span class="lineno"> 3938</span>&#160;            item: <span class="keyword">self</span>.currentItem,</div>
<div class="line"><a name="l03939"></a><span class="lineno"> 3939</span>&#160;            sender: inst ? inst.element : null</div>
<div class="line"><a name="l03940"></a><span class="lineno"> 3940</span>&#160;        };</div>
<div class="line"><a name="l03941"></a><span class="lineno"> 3941</span>&#160;    }</div>
<div class="line"><a name="l03942"></a><span class="lineno"> 3942</span>&#160;</div>
<div class="line"><a name="l03943"></a><span class="lineno"> 3943</span>&#160;});</div>
<div class="line"><a name="l03944"></a><span class="lineno"> 3944</span>&#160;</div>
<div class="line"><a name="l03945"></a><span class="lineno"> 3945</span>&#160;$.extend($.ui.sortable, {</div>
<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l03947"></a><span class="lineno"> 3947</span>&#160;});</div>
<div class="line"><a name="l03948"></a><span class="lineno"> 3948</span>&#160;</div>
<div class="line"><a name="l03949"></a><span class="lineno"> 3949</span>&#160;})(jQuery);</div>
<div class="line"><a name="l03950"></a><span class="lineno"> 3950</span>&#160;</div>
<div class="line"><a name="l03951"></a><span class="lineno"> 3951</span>&#160;;jQuery.effects || (<span class="keyword">function</span>($, undefined) {</div>
<div class="line"><a name="l03952"></a><span class="lineno"> 3952</span>&#160;</div>
<div class="line"><a name="l03953"></a><span class="lineno"> 3953</span>&#160;$.effects = {};</div>
<div class="line"><a name="l03954"></a><span class="lineno"> 3954</span>&#160;</div>
<div class="line"><a name="l03955"></a><span class="lineno"> 3955</span>&#160;</div>
<div class="line"><a name="l03956"></a><span class="lineno"> 3956</span>&#160;</div>
<div class="line"><a name="l03957"></a><span class="lineno"> 3957</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l03958"></a><span class="lineno"> 3958</span>&#160;<span class="comment">/****************************** COLOR ANIMATIONS ******************************/</span></div>
<div class="line"><a name="l03959"></a><span class="lineno"> 3959</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l03960"></a><span class="lineno"> 3960</span>&#160;</div>
<div class="line"><a name="l03961"></a><span class="lineno"> 3961</span>&#160;<span class="comment">// override the animation for color styles</span></div>
<div class="line"><a name="l03962"></a><span class="lineno"> 3962</span>&#160;$.each([<span class="stringliteral">&#39;backgroundColor&#39;</span>, <span class="stringliteral">&#39;borderBottomColor&#39;</span>, <span class="stringliteral">&#39;borderLeftColor&#39;</span>,</div>
<div class="line"><a name="l03963"></a><span class="lineno"> 3963</span>&#160;    <span class="stringliteral">&#39;borderRightColor&#39;</span>, <span class="stringliteral">&#39;borderTopColor&#39;</span>, <span class="stringliteral">&#39;borderColor&#39;</span>, <span class="stringliteral">&#39;color&#39;</span>, <span class="stringliteral">&#39;outlineColor&#39;</span>],</div>
<div class="line"><a name="l03964"></a><span class="lineno"> 3964</span>&#160;<span class="keyword">function</span>(i, attr) {</div>
<div class="line"><a name="l03965"></a><span class="lineno"> 3965</span>&#160;    $.fx.step[attr] = <span class="keyword">function</span>(fx) {</div>
<div class="line"><a name="l03966"></a><span class="lineno"> 3966</span>&#160;        <span class="keywordflow">if</span> (!fx.colorInit) {</div>
<div class="line"><a name="l03967"></a><span class="lineno"> 3967</span>&#160;            fx.start = getColor(fx.elem, attr);</div>
<div class="line"><a name="l03968"></a><span class="lineno"> 3968</span>&#160;            fx.end = getRGB(fx.end);</div>
<div class="line"><a name="l03969"></a><span class="lineno"> 3969</span>&#160;            fx.colorInit = <span class="keyword">true</span>;</div>
<div class="line"><a name="l03970"></a><span class="lineno"> 3970</span>&#160;        }</div>
<div class="line"><a name="l03971"></a><span class="lineno"> 3971</span>&#160;</div>
<div class="line"><a name="l03972"></a><span class="lineno"> 3972</span>&#160;        fx.elem.style[attr] = <span class="stringliteral">&#39;rgb(&#39;</span> +</div>
<div class="line"><a name="l03973"></a><span class="lineno"> 3973</span>&#160;            Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + <span class="charliteral">&#39;,&#39;</span> +</div>
<div class="line"><a name="l03974"></a><span class="lineno"> 3974</span>&#160;            Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + <span class="charliteral">&#39;,&#39;</span> +</div>
<div class="line"><a name="l03975"></a><span class="lineno"> 3975</span>&#160;            Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + <span class="charliteral">&#39;)&#39;</span>;</div>
<div class="line"><a name="l03976"></a><span class="lineno"> 3976</span>&#160;    };</div>
<div class="line"><a name="l03977"></a><span class="lineno"> 3977</span>&#160;});</div>
<div class="line"><a name="l03978"></a><span class="lineno"> 3978</span>&#160;</div>
<div class="line"><a name="l03979"></a><span class="lineno"> 3979</span>&#160;<span class="comment">// Color Conversion functions from highlightFade</span></div>
<div class="line"><a name="l03980"></a><span class="lineno"> 3980</span>&#160;<span class="comment">// By Blair Mitchelmore</span></div>
<div class="line"><a name="l03981"></a><span class="lineno"> 3981</span>&#160;<span class="comment">// http://jquery.offput.ca/highlightFade/</span></div>
<div class="line"><a name="l03982"></a><span class="lineno"> 3982</span>&#160;</div>
<div class="line"><a name="l03983"></a><span class="lineno"> 3983</span>&#160;<span class="comment">// Parse strings looking for color tuples [255,255,255]</span></div>
<div class="line"><a name="l03984"></a><span class="lineno"> 3984</span>&#160;<span class="keyword">function</span> getRGB(color) {</div>
<div class="line"><a name="l03985"></a><span class="lineno"> 3985</span>&#160;        var result;</div>
<div class="line"><a name="l03986"></a><span class="lineno"> 3986</span>&#160;</div>
<div class="line"><a name="l03987"></a><span class="lineno"> 3987</span>&#160;        <span class="comment">// Check if we&#39;re already dealing with an array of colors</span></div>
<div class="line"><a name="l03988"></a><span class="lineno"> 3988</span>&#160;        <span class="keywordflow">if</span> ( color &amp;&amp; color.constructor == Array &amp;&amp; color.length == 3 )</div>
<div class="line"><a name="l03989"></a><span class="lineno"> 3989</span>&#160;                <span class="keywordflow">return</span> color;</div>
<div class="line"><a name="l03990"></a><span class="lineno"> 3990</span>&#160;</div>
<div class="line"><a name="l03991"></a><span class="lineno"> 3991</span>&#160;        <span class="comment">// Look for rgb(num,num,num)</span></div>
<div class="line"><a name="l03992"></a><span class="lineno"> 3992</span>&#160;        <span class="keywordflow">if</span> (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))</div>
<div class="line"><a name="l03993"></a><span class="lineno"> 3993</span>&#160;                <span class="keywordflow">return</span> [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];</div>
<div class="line"><a name="l03994"></a><span class="lineno"> 3994</span>&#160;</div>
<div class="line"><a name="l03995"></a><span class="lineno"> 3995</span>&#160;        <span class="comment">// Look for rgb(num%,num%,num%)</span></div>
<div class="line"><a name="l03996"></a><span class="lineno"> 3996</span>&#160;        <span class="keywordflow">if</span> (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))</div>
<div class="line"><a name="l03997"></a><span class="lineno"> 3997</span>&#160;                <span class="keywordflow">return</span> [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];</div>
<div class="line"><a name="l03998"></a><span class="lineno"> 3998</span>&#160;</div>
<div class="line"><a name="l03999"></a><span class="lineno"> 3999</span>&#160;        <span class="comment">// Look for #a0b1c2</span></div>
<div class="line"><a name="l04000"></a><span class="lineno"> 4000</span>&#160;        <span class="keywordflow">if</span> (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))</div>
<div class="line"><a name="l04001"></a><span class="lineno"> 4001</span>&#160;                <span class="keywordflow">return</span> [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];</div>
<div class="line"><a name="l04002"></a><span class="lineno"> 4002</span>&#160;</div>
<div class="line"><a name="l04003"></a><span class="lineno"> 4003</span>&#160;        <span class="comment">// Look for #fff</span></div>
<div class="line"><a name="l04004"></a><span class="lineno"> 4004</span>&#160;        <span class="keywordflow">if</span> (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))</div>
<div class="line"><a name="l04005"></a><span class="lineno"> 4005</span>&#160;                <span class="keywordflow">return</span> [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];</div>
<div class="line"><a name="l04006"></a><span class="lineno"> 4006</span>&#160;</div>
<div class="line"><a name="l04007"></a><span class="lineno"> 4007</span>&#160;        <span class="comment">// Look for rgba(0, 0, 0, 0) == transparent in Safari 3</span></div>
<div class="line"><a name="l04008"></a><span class="lineno"> 4008</span>&#160;        <span class="keywordflow">if</span> (result = /rgba\(0, 0, 0, 0\)/.exec(color))</div>
<div class="line"><a name="l04009"></a><span class="lineno"> 4009</span>&#160;                <span class="keywordflow">return</span> colors[<span class="stringliteral">&#39;transparent&#39;</span>];</div>
<div class="line"><a name="l04010"></a><span class="lineno"> 4010</span>&#160;</div>
<div class="line"><a name="l04011"></a><span class="lineno"> 4011</span>&#160;        <span class="comment">// Otherwise, we&#39;re most likely dealing with a named color</span></div>
<div class="line"><a name="l04012"></a><span class="lineno"> 4012</span>&#160;        <span class="keywordflow">return</span> colors[$.trim(color).toLowerCase()];</div>
<div class="line"><a name="l04013"></a><span class="lineno"> 4013</span>&#160;}</div>
<div class="line"><a name="l04014"></a><span class="lineno"> 4014</span>&#160;</div>
<div class="line"><a name="l04015"></a><span class="lineno"> 4015</span>&#160;<span class="keyword">function</span> getColor(elem, attr) {</div>
<div class="line"><a name="l04016"></a><span class="lineno"> 4016</span>&#160;        var color;</div>
<div class="line"><a name="l04017"></a><span class="lineno"> 4017</span>&#160;</div>
<div class="line"><a name="l04018"></a><span class="lineno"> 4018</span>&#160;        <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l04019"></a><span class="lineno"> 4019</span>&#160;                color = $.curCSS(elem, attr);</div>
<div class="line"><a name="l04020"></a><span class="lineno"> 4020</span>&#160;</div>
<div class="line"><a name="l04021"></a><span class="lineno"> 4021</span>&#160;                <span class="comment">// Keep going until we find an element that has color, or we hit the body</span></div>
<div class="line"><a name="l04022"></a><span class="lineno"> 4022</span>&#160;                <span class="keywordflow">if</span> ( color != <span class="stringliteral">&#39;&#39;</span> &amp;&amp; color != <span class="stringliteral">&#39;transparent&#39;</span> || $.nodeName(elem, <span class="stringliteral">&quot;body&quot;</span>) )</div>
<div class="line"><a name="l04023"></a><span class="lineno"> 4023</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04024"></a><span class="lineno"> 4024</span>&#160;</div>
<div class="line"><a name="l04025"></a><span class="lineno"> 4025</span>&#160;                attr = <span class="stringliteral">&quot;backgroundColor&quot;</span>;</div>
<div class="line"><a name="l04026"></a><span class="lineno"> 4026</span>&#160;        } <span class="keywordflow">while</span> ( elem = elem.parentNode );</div>
<div class="line"><a name="l04027"></a><span class="lineno"> 4027</span>&#160;</div>
<div class="line"><a name="l04028"></a><span class="lineno"> 4028</span>&#160;        <span class="keywordflow">return</span> getRGB(color);</div>
<div class="line"><a name="l04029"></a><span class="lineno"> 4029</span>&#160;};</div>
<div class="line"><a name="l04030"></a><span class="lineno"> 4030</span>&#160;</div>
<div class="line"><a name="l04031"></a><span class="lineno"> 4031</span>&#160;<span class="comment">// Some named colors to work with</span></div>
<div class="line"><a name="l04032"></a><span class="lineno"> 4032</span>&#160;<span class="comment">// From Interface by Stefan Petre</span></div>
<div class="line"><a name="l04033"></a><span class="lineno"> 4033</span>&#160;<span class="comment">// http://interface.eyecon.ro/</span></div>
<div class="line"><a name="l04034"></a><span class="lineno"> 4034</span>&#160;</div>
<div class="line"><a name="l04035"></a><span class="lineno"> 4035</span>&#160;var colors = {</div>
<div class="line"><a name="l04036"></a><span class="lineno"> 4036</span>&#160;    aqua:[0,255,255],</div>
<div class="line"><a name="l04037"></a><span class="lineno"> 4037</span>&#160;    azure:[240,255,255],</div>
<div class="line"><a name="l04038"></a><span class="lineno"> 4038</span>&#160;    beige:[245,245,220],</div>
<div class="line"><a name="l04039"></a><span class="lineno"> 4039</span>&#160;    black:[0,0,0],</div>
<div class="line"><a name="l04040"></a><span class="lineno"> 4040</span>&#160;    blue:[0,0,255],</div>
<div class="line"><a name="l04041"></a><span class="lineno"> 4041</span>&#160;    brown:[165,42,42],</div>
<div class="line"><a name="l04042"></a><span class="lineno"> 4042</span>&#160;    cyan:[0,255,255],</div>
<div class="line"><a name="l04043"></a><span class="lineno"> 4043</span>&#160;    darkblue:[0,0,139],</div>
<div class="line"><a name="l04044"></a><span class="lineno"> 4044</span>&#160;    darkcyan:[0,139,139],</div>
<div class="line"><a name="l04045"></a><span class="lineno"> 4045</span>&#160;    darkgrey:[169,169,169],</div>
<div class="line"><a name="l04046"></a><span class="lineno"> 4046</span>&#160;    darkgreen:[0,100,0],</div>
<div class="line"><a name="l04047"></a><span class="lineno"> 4047</span>&#160;    darkkhaki:[189,183,107],</div>
<div class="line"><a name="l04048"></a><span class="lineno"> 4048</span>&#160;    darkmagenta:[139,0,139],</div>
<div class="line"><a name="l04049"></a><span class="lineno"> 4049</span>&#160;    darkolivegreen:[85,107,47],</div>
<div class="line"><a name="l04050"></a><span class="lineno"> 4050</span>&#160;    darkorange:[255,140,0],</div>
<div class="line"><a name="l04051"></a><span class="lineno"> 4051</span>&#160;    darkorchid:[153,50,204],</div>
<div class="line"><a name="l04052"></a><span class="lineno"> 4052</span>&#160;    darkred:[139,0,0],</div>
<div class="line"><a name="l04053"></a><span class="lineno"> 4053</span>&#160;    darksalmon:[233,150,122],</div>
<div class="line"><a name="l04054"></a><span class="lineno"> 4054</span>&#160;    darkviolet:[148,0,211],</div>
<div class="line"><a name="l04055"></a><span class="lineno"> 4055</span>&#160;    fuchsia:[255,0,255],</div>
<div class="line"><a name="l04056"></a><span class="lineno"> 4056</span>&#160;    gold:[255,215,0],</div>
<div class="line"><a name="l04057"></a><span class="lineno"> 4057</span>&#160;    green:[0,128,0],</div>
<div class="line"><a name="l04058"></a><span class="lineno"> 4058</span>&#160;    indigo:[75,0,130],</div>
<div class="line"><a name="l04059"></a><span class="lineno"> 4059</span>&#160;    khaki:[240,230,140],</div>
<div class="line"><a name="l04060"></a><span class="lineno"> 4060</span>&#160;    lightblue:[173,216,230],</div>
<div class="line"><a name="l04061"></a><span class="lineno"> 4061</span>&#160;    lightcyan:[224,255,255],</div>
<div class="line"><a name="l04062"></a><span class="lineno"> 4062</span>&#160;    lightgreen:[144,238,144],</div>
<div class="line"><a name="l04063"></a><span class="lineno"> 4063</span>&#160;    lightgrey:[211,211,211],</div>
<div class="line"><a name="l04064"></a><span class="lineno"> 4064</span>&#160;    lightpink:[255,182,193],</div>
<div class="line"><a name="l04065"></a><span class="lineno"> 4065</span>&#160;    lightyellow:[255,255,224],</div>
<div class="line"><a name="l04066"></a><span class="lineno"> 4066</span>&#160;    lime:[0,255,0],</div>
<div class="line"><a name="l04067"></a><span class="lineno"> 4067</span>&#160;    magenta:[255,0,255],</div>
<div class="line"><a name="l04068"></a><span class="lineno"> 4068</span>&#160;    maroon:[128,0,0],</div>
<div class="line"><a name="l04069"></a><span class="lineno"> 4069</span>&#160;    navy:[0,0,128],</div>
<div class="line"><a name="l04070"></a><span class="lineno"> 4070</span>&#160;    olive:[128,128,0],</div>
<div class="line"><a name="l04071"></a><span class="lineno"> 4071</span>&#160;    orange:[255,165,0],</div>
<div class="line"><a name="l04072"></a><span class="lineno"> 4072</span>&#160;    pink:[255,192,203],</div>
<div class="line"><a name="l04073"></a><span class="lineno"> 4073</span>&#160;    purple:[128,0,128],</div>
<div class="line"><a name="l04074"></a><span class="lineno"> 4074</span>&#160;    violet:[128,0,128],</div>
<div class="line"><a name="l04075"></a><span class="lineno"> 4075</span>&#160;    red:[255,0,0],</div>
<div class="line"><a name="l04076"></a><span class="lineno"> 4076</span>&#160;    silver:[192,192,192],</div>
<div class="line"><a name="l04077"></a><span class="lineno"> 4077</span>&#160;    white:[255,255,255],</div>
<div class="line"><a name="l04078"></a><span class="lineno"> 4078</span>&#160;    yellow:[255,255,0],</div>
<div class="line"><a name="l04079"></a><span class="lineno"> 4079</span>&#160;    transparent: [255,255,255]</div>
<div class="line"><a name="l04080"></a><span class="lineno"> 4080</span>&#160;};</div>
<div class="line"><a name="l04081"></a><span class="lineno"> 4081</span>&#160;</div>
<div class="line"><a name="l04082"></a><span class="lineno"> 4082</span>&#160;</div>
<div class="line"><a name="l04083"></a><span class="lineno"> 4083</span>&#160;</div>
<div class="line"><a name="l04084"></a><span class="lineno"> 4084</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l04085"></a><span class="lineno"> 4085</span>&#160;<span class="comment">/****************************** CLASS ANIMATIONS ******************************/</span></div>
<div class="line"><a name="l04086"></a><span class="lineno"> 4086</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l04087"></a><span class="lineno"> 4087</span>&#160;</div>
<div class="line"><a name="l04088"></a><span class="lineno"> 4088</span>&#160;var classAnimationActions = [<span class="stringliteral">&#39;add&#39;</span>, <span class="stringliteral">&#39;remove&#39;</span>, <span class="stringliteral">&#39;toggle&#39;</span>],</div>
<div class="line"><a name="l04089"></a><span class="lineno"> 4089</span>&#160;    shorthandStyles = {</div>
<div class="line"><a name="l04090"></a><span class="lineno"> 4090</span>&#160;        border: 1,</div>
<div class="line"><a name="l04091"></a><span class="lineno"> 4091</span>&#160;        borderBottom: 1,</div>
<div class="line"><a name="l04092"></a><span class="lineno"> 4092</span>&#160;        borderColor: 1,</div>
<div class="line"><a name="l04093"></a><span class="lineno"> 4093</span>&#160;        borderLeft: 1,</div>
<div class="line"><a name="l04094"></a><span class="lineno"> 4094</span>&#160;        borderRight: 1,</div>
<div class="line"><a name="l04095"></a><span class="lineno"> 4095</span>&#160;        borderTop: 1,</div>
<div class="line"><a name="l04096"></a><span class="lineno"> 4096</span>&#160;        borderWidth: 1,</div>
<div class="line"><a name="l04097"></a><span class="lineno"> 4097</span>&#160;        margin: 1,</div>
<div class="line"><a name="l04098"></a><span class="lineno"> 4098</span>&#160;        padding: 1</div>
<div class="line"><a name="l04099"></a><span class="lineno"> 4099</span>&#160;    };</div>
<div class="line"><a name="l04100"></a><span class="lineno"> 4100</span>&#160;</div>
<div class="line"><a name="l04101"></a><span class="lineno"> 4101</span>&#160;<span class="keyword">function</span> getElementStyles() {</div>
<div class="line"><a name="l04102"></a><span class="lineno"> 4102</span>&#160;    var style = document.defaultView</div>
<div class="line"><a name="l04103"></a><span class="lineno"> 4103</span>&#160;            ? document.defaultView.getComputedStyle(<span class="keyword">this</span>, null)</div>
<div class="line"><a name="l04104"></a><span class="lineno"> 4104</span>&#160;            : this.currentStyle,</div>
<div class="line"><a name="l04105"></a><span class="lineno"> 4105</span>&#160;        newStyle = {},</div>
<div class="line"><a name="l04106"></a><span class="lineno"> 4106</span>&#160;        key,</div>
<div class="line"><a name="l04107"></a><span class="lineno"> 4107</span>&#160;        camelCase;</div>
<div class="line"><a name="l04108"></a><span class="lineno"> 4108</span>&#160;</div>
<div class="line"><a name="l04109"></a><span class="lineno"> 4109</span>&#160;    <span class="comment">// webkit enumerates style porperties</span></div>
<div class="line"><a name="l04110"></a><span class="lineno"> 4110</span>&#160;    <span class="keywordflow">if</span> (style &amp;&amp; style.length &amp;&amp; style[0] &amp;&amp; style[style[0]]) {</div>
<div class="line"><a name="l04111"></a><span class="lineno"> 4111</span>&#160;        var len = style.length;</div>
<div class="line"><a name="l04112"></a><span class="lineno"> 4112</span>&#160;        <span class="keywordflow">while</span> (len--) {</div>
<div class="line"><a name="l04113"></a><span class="lineno"> 4113</span>&#160;            key = style[len];</div>
<div class="line"><a name="l04114"></a><span class="lineno"> 4114</span>&#160;            <span class="keywordflow">if</span> (typeof style[key] == <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l04115"></a><span class="lineno"> 4115</span>&#160;                camelCase = key.replace(/\-(\w)/g, <span class="keyword">function</span>(all, letter){</div>
<div class="line"><a name="l04116"></a><span class="lineno"> 4116</span>&#160;                    <span class="keywordflow">return</span> letter.toUpperCase();</div>
<div class="line"><a name="l04117"></a><span class="lineno"> 4117</span>&#160;                });</div>
<div class="line"><a name="l04118"></a><span class="lineno"> 4118</span>&#160;                newStyle[camelCase] = style[key];</div>
<div class="line"><a name="l04119"></a><span class="lineno"> 4119</span>&#160;            }</div>
<div class="line"><a name="l04120"></a><span class="lineno"> 4120</span>&#160;        }</div>
<div class="line"><a name="l04121"></a><span class="lineno"> 4121</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04122"></a><span class="lineno"> 4122</span>&#160;        <span class="keywordflow">for</span> (key in style) {</div>
<div class="line"><a name="l04123"></a><span class="lineno"> 4123</span>&#160;            <span class="keywordflow">if</span> (typeof style[key] === <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l04124"></a><span class="lineno"> 4124</span>&#160;                newStyle[key] = style[key];</div>
<div class="line"><a name="l04125"></a><span class="lineno"> 4125</span>&#160;            }</div>
<div class="line"><a name="l04126"></a><span class="lineno"> 4126</span>&#160;        }</div>
<div class="line"><a name="l04127"></a><span class="lineno"> 4127</span>&#160;    }</div>
<div class="line"><a name="l04128"></a><span class="lineno"> 4128</span>&#160;    </div>
<div class="line"><a name="l04129"></a><span class="lineno"> 4129</span>&#160;    <span class="keywordflow">return</span> newStyle;</div>
<div class="line"><a name="l04130"></a><span class="lineno"> 4130</span>&#160;}</div>
<div class="line"><a name="l04131"></a><span class="lineno"> 4131</span>&#160;</div>
<div class="line"><a name="l04132"></a><span class="lineno"> 4132</span>&#160;<span class="keyword">function</span> filterStyles(styles) {</div>
<div class="line"><a name="l04133"></a><span class="lineno"> 4133</span>&#160;    var name, value;</div>
<div class="line"><a name="l04134"></a><span class="lineno"> 4134</span>&#160;    <span class="keywordflow">for</span> (name in styles) {</div>
<div class="line"><a name="l04135"></a><span class="lineno"> 4135</span>&#160;        value = styles[name];</div>
<div class="line"><a name="l04136"></a><span class="lineno"> 4136</span>&#160;        <span class="keywordflow">if</span> (</div>
<div class="line"><a name="l04137"></a><span class="lineno"> 4137</span>&#160;            <span class="comment">// ignore null and undefined values</span></div>
<div class="line"><a name="l04138"></a><span class="lineno"> 4138</span>&#160;            value == null ||</div>
<div class="line"><a name="l04139"></a><span class="lineno"> 4139</span>&#160;            <span class="comment">// ignore functions (when does this occur?)</span></div>
<div class="line"><a name="l04140"></a><span class="lineno"> 4140</span>&#160;            $.isFunction(value) ||</div>
<div class="line"><a name="l04141"></a><span class="lineno"> 4141</span>&#160;            <span class="comment">// shorthand styles that need to be expanded</span></div>
<div class="line"><a name="l04142"></a><span class="lineno"> 4142</span>&#160;            name in shorthandStyles ||</div>
<div class="line"><a name="l04143"></a><span class="lineno"> 4143</span>&#160;            <span class="comment">// ignore scrollbars (break in IE)</span></div>
<div class="line"><a name="l04144"></a><span class="lineno"> 4144</span>&#160;            (/scrollbar/).test(name) ||</div>
<div class="line"><a name="l04145"></a><span class="lineno"> 4145</span>&#160;</div>
<div class="line"><a name="l04146"></a><span class="lineno"> 4146</span>&#160;            <span class="comment">// only colors or values that can be converted to numbers</span></div>
<div class="line"><a name="l04147"></a><span class="lineno"> 4147</span>&#160;            (!(/color/i).test(name) &amp;&amp; isNaN(parseFloat(value)))</div>
<div class="line"><a name="l04148"></a><span class="lineno"> 4148</span>&#160;        ) {</div>
<div class="line"><a name="l04149"></a><span class="lineno"> 4149</span>&#160;            <span class="keyword">delete</span> styles[name];</div>
<div class="line"><a name="l04150"></a><span class="lineno"> 4150</span>&#160;        }</div>
<div class="line"><a name="l04151"></a><span class="lineno"> 4151</span>&#160;    }</div>
<div class="line"><a name="l04152"></a><span class="lineno"> 4152</span>&#160;    </div>
<div class="line"><a name="l04153"></a><span class="lineno"> 4153</span>&#160;    <span class="keywordflow">return</span> styles;</div>
<div class="line"><a name="l04154"></a><span class="lineno"> 4154</span>&#160;}</div>
<div class="line"><a name="l04155"></a><span class="lineno"> 4155</span>&#160;</div>
<div class="line"><a name="l04156"></a><span class="lineno"> 4156</span>&#160;<span class="keyword">function</span> styleDifference(oldStyle, newStyle) {</div>
<div class="line"><a name="l04157"></a><span class="lineno"> 4157</span>&#160;    var diff = { _: 0 }, <span class="comment">// http://dev.jquery.com/ticket/5459</span></div>
<div class="line"><a name="l04158"></a><span class="lineno"> 4158</span>&#160;        name;</div>
<div class="line"><a name="l04159"></a><span class="lineno"> 4159</span>&#160;</div>
<div class="line"><a name="l04160"></a><span class="lineno"> 4160</span>&#160;    <span class="keywordflow">for</span> (name in newStyle) {</div>
<div class="line"><a name="l04161"></a><span class="lineno"> 4161</span>&#160;        <span class="keywordflow">if</span> (oldStyle[name] != newStyle[name]) {</div>
<div class="line"><a name="l04162"></a><span class="lineno"> 4162</span>&#160;            diff[name] = newStyle[name];</div>
<div class="line"><a name="l04163"></a><span class="lineno"> 4163</span>&#160;        }</div>
<div class="line"><a name="l04164"></a><span class="lineno"> 4164</span>&#160;    }</div>
<div class="line"><a name="l04165"></a><span class="lineno"> 4165</span>&#160;</div>
<div class="line"><a name="l04166"></a><span class="lineno"> 4166</span>&#160;    <span class="keywordflow">return</span> diff;</div>
<div class="line"><a name="l04167"></a><span class="lineno"> 4167</span>&#160;}</div>
<div class="line"><a name="l04168"></a><span class="lineno"> 4168</span>&#160;</div>
<div class="line"><a name="l04169"></a><span class="lineno"> 4169</span>&#160;$.effects.animateClass = <span class="keyword">function</span>(value, duration, easing, callback) {</div>
<div class="line"><a name="l04170"></a><span class="lineno"> 4170</span>&#160;    <span class="keywordflow">if</span> ($.isFunction(easing)) {</div>
<div class="line"><a name="l04171"></a><span class="lineno"> 4171</span>&#160;        callback = easing;</div>
<div class="line"><a name="l04172"></a><span class="lineno"> 4172</span>&#160;        easing = null;</div>
<div class="line"><a name="l04173"></a><span class="lineno"> 4173</span>&#160;    }</div>
<div class="line"><a name="l04174"></a><span class="lineno"> 4174</span>&#160;</div>
<div class="line"><a name="l04175"></a><span class="lineno"> 4175</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04176"></a><span class="lineno"> 4176</span>&#160;        var that = $(<span class="keyword">this</span>),</div>
<div class="line"><a name="l04177"></a><span class="lineno"> 4177</span>&#160;            originalStyleAttr = that.attr(<span class="stringliteral">&#39;style&#39;</span>) || <span class="charliteral">&#39; &#39;</span>,</div>
<div class="line"><a name="l04178"></a><span class="lineno"> 4178</span>&#160;            originalStyle = filterStyles(getElementStyles.call(<span class="keyword">this</span>)),</div>
<div class="line"><a name="l04179"></a><span class="lineno"> 4179</span>&#160;            newStyle,</div>
<div class="line"><a name="l04180"></a><span class="lineno"> 4180</span>&#160;            className = that.attr(<span class="stringliteral">&#39;class&#39;</span>) || <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l04181"></a><span class="lineno"> 4181</span>&#160;</div>
<div class="line"><a name="l04182"></a><span class="lineno"> 4182</span>&#160;        $.each(classAnimationActions, <span class="keyword">function</span>(i, action) {</div>
<div class="line"><a name="l04183"></a><span class="lineno"> 4183</span>&#160;            <span class="keywordflow">if</span> (value[action]) {</div>
<div class="line"><a name="l04184"></a><span class="lineno"> 4184</span>&#160;                that[action + <span class="stringliteral">&#39;Class&#39;</span>](value[action]);</div>
<div class="line"><a name="l04185"></a><span class="lineno"> 4185</span>&#160;            }</div>
<div class="line"><a name="l04186"></a><span class="lineno"> 4186</span>&#160;        });</div>
<div class="line"><a name="l04187"></a><span class="lineno"> 4187</span>&#160;        newStyle = filterStyles(getElementStyles.call(<span class="keyword">this</span>));</div>
<div class="line"><a name="l04188"></a><span class="lineno"> 4188</span>&#160;        that.attr(<span class="stringliteral">&#39;class&#39;</span>, className);</div>
<div class="line"><a name="l04189"></a><span class="lineno"> 4189</span>&#160;</div>
<div class="line"><a name="l04190"></a><span class="lineno"> 4190</span>&#160;        that.animate(styleDifference(originalStyle, newStyle), {</div>
<div class="line"><a name="l04191"></a><span class="lineno"> 4191</span>&#160;            queue: <span class="keyword">false</span>,</div>
<div class="line"><a name="l04192"></a><span class="lineno"> 4192</span>&#160;            duration: duration,</div>
<div class="line"><a name="l04193"></a><span class="lineno"> 4193</span>&#160;            easing: easing,</div>
<div class="line"><a name="l04194"></a><span class="lineno"> 4194</span>&#160;            complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l04195"></a><span class="lineno"> 4195</span>&#160;                $.each(classAnimationActions, <span class="keyword">function</span>(i, action) {</div>
<div class="line"><a name="l04196"></a><span class="lineno"> 4196</span>&#160;                    <span class="keywordflow">if</span> (value[action]) { that[action + <span class="stringliteral">&#39;Class&#39;</span>](value[action]); }</div>
<div class="line"><a name="l04197"></a><span class="lineno"> 4197</span>&#160;                });</div>
<div class="line"><a name="l04198"></a><span class="lineno"> 4198</span>&#160;                <span class="comment">// work around bug in IE by clearing the cssText before setting it</span></div>
<div class="line"><a name="l04199"></a><span class="lineno"> 4199</span>&#160;                <span class="keywordflow">if</span> (typeof that.attr(<span class="stringliteral">&#39;style&#39;</span>) == <span class="stringliteral">&#39;object&#39;</span>) {</div>
<div class="line"><a name="l04200"></a><span class="lineno"> 4200</span>&#160;                    that.attr(<span class="stringliteral">&#39;style&#39;</span>).cssText = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l04201"></a><span class="lineno"> 4201</span>&#160;                    that.attr(<span class="stringliteral">&#39;style&#39;</span>).cssText = originalStyleAttr;</div>
<div class="line"><a name="l04202"></a><span class="lineno"> 4202</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04203"></a><span class="lineno"> 4203</span>&#160;                    that.attr(<span class="stringliteral">&#39;style&#39;</span>, originalStyleAttr);</div>
<div class="line"><a name="l04204"></a><span class="lineno"> 4204</span>&#160;                }</div>
<div class="line"><a name="l04205"></a><span class="lineno"> 4205</span>&#160;                <span class="keywordflow">if</span> (callback) { callback.apply(<span class="keyword">this</span>, arguments); }</div>
<div class="line"><a name="l04206"></a><span class="lineno"> 4206</span>&#160;                $.dequeue( <span class="keyword">this</span> );</div>
<div class="line"><a name="l04207"></a><span class="lineno"> 4207</span>&#160;            }</div>
<div class="line"><a name="l04208"></a><span class="lineno"> 4208</span>&#160;        });</div>
<div class="line"><a name="l04209"></a><span class="lineno"> 4209</span>&#160;    });</div>
<div class="line"><a name="l04210"></a><span class="lineno"> 4210</span>&#160;};</div>
<div class="line"><a name="l04211"></a><span class="lineno"> 4211</span>&#160;</div>
<div class="line"><a name="l04212"></a><span class="lineno"> 4212</span>&#160;$.fn.extend({</div>
<div class="line"><a name="l04213"></a><span class="lineno"> 4213</span>&#160;    _addClass: $.fn.addClass,</div>
<div class="line"><a name="l04214"></a><span class="lineno"> 4214</span>&#160;    addClass: <span class="keyword">function</span>(classNames, speed, easing, callback) {</div>
<div class="line"><a name="l04215"></a><span class="lineno"> 4215</span>&#160;        <span class="keywordflow">return</span> speed ? $.effects.animateClass.apply(<span class="keyword">this</span>, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);</div>
<div class="line"><a name="l04216"></a><span class="lineno"> 4216</span>&#160;    },</div>
<div class="line"><a name="l04217"></a><span class="lineno"> 4217</span>&#160;</div>
<div class="line"><a name="l04218"></a><span class="lineno"> 4218</span>&#160;    _removeClass: $.fn.removeClass,</div>
<div class="line"><a name="l04219"></a><span class="lineno"> 4219</span>&#160;    removeClass: <span class="keyword">function</span>(classNames,speed,easing,callback) {</div>
<div class="line"><a name="l04220"></a><span class="lineno"> 4220</span>&#160;        <span class="keywordflow">return</span> speed ? $.effects.animateClass.apply(<span class="keyword">this</span>, [{ <span class="keyword">remove</span>: classNames },speed,easing,callback]) : this._removeClass(classNames);</div>
<div class="line"><a name="l04221"></a><span class="lineno"> 4221</span>&#160;    },</div>
<div class="line"><a name="l04222"></a><span class="lineno"> 4222</span>&#160;</div>
<div class="line"><a name="l04223"></a><span class="lineno"> 4223</span>&#160;    _toggleClass: $.fn.toggleClass,</div>
<div class="line"><a name="l04224"></a><span class="lineno"> 4224</span>&#160;    toggleClass: <span class="keyword">function</span>(classNames, force, speed, easing, callback) {</div>
<div class="line"><a name="l04225"></a><span class="lineno"> 4225</span>&#160;        <span class="keywordflow">if</span> ( typeof force == <span class="stringliteral">&quot;boolean&quot;</span> || force === undefined ) {</div>
<div class="line"><a name="l04226"></a><span class="lineno"> 4226</span>&#160;            <span class="keywordflow">if</span> ( !speed ) {</div>
<div class="line"><a name="l04227"></a><span class="lineno"> 4227</span>&#160;                <span class="comment">// without speed parameter;</span></div>
<div class="line"><a name="l04228"></a><span class="lineno"> 4228</span>&#160;                <span class="keywordflow">return</span> this._toggleClass(classNames, force);</div>
<div class="line"><a name="l04229"></a><span class="lineno"> 4229</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04230"></a><span class="lineno"> 4230</span>&#160;                <span class="keywordflow">return</span> $.effects.animateClass.apply(<span class="keyword">this</span>, [(force?{add:classNames}:{<span class="keyword">remove</span>:classNames}),speed,easing,callback]);</div>
<div class="line"><a name="l04231"></a><span class="lineno"> 4231</span>&#160;            }</div>
<div class="line"><a name="l04232"></a><span class="lineno"> 4232</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04233"></a><span class="lineno"> 4233</span>&#160;            <span class="comment">// without switch parameter;</span></div>
<div class="line"><a name="l04234"></a><span class="lineno"> 4234</span>&#160;            <span class="keywordflow">return</span> $.effects.animateClass.apply(<span class="keyword">this</span>, [{ toggle: classNames },force,speed,easing]);</div>
<div class="line"><a name="l04235"></a><span class="lineno"> 4235</span>&#160;        }</div>
<div class="line"><a name="l04236"></a><span class="lineno"> 4236</span>&#160;    },</div>
<div class="line"><a name="l04237"></a><span class="lineno"> 4237</span>&#160;</div>
<div class="line"><a name="l04238"></a><span class="lineno"> 4238</span>&#160;    switchClass: <span class="keyword">function</span>(<span class="keyword">remove</span>,add,speed,easing,callback) {</div>
<div class="line"><a name="l04239"></a><span class="lineno"> 4239</span>&#160;        <span class="keywordflow">return</span> $.effects.animateClass.apply(<span class="keyword">this</span>, [{ add: add, <span class="keyword">remove</span>: <span class="keyword">remove</span> },speed,easing,callback]);</div>
<div class="line"><a name="l04240"></a><span class="lineno"> 4240</span>&#160;    }</div>
<div class="line"><a name="l04241"></a><span class="lineno"> 4241</span>&#160;});</div>
<div class="line"><a name="l04242"></a><span class="lineno"> 4242</span>&#160;</div>
<div class="line"><a name="l04243"></a><span class="lineno"> 4243</span>&#160;</div>
<div class="line"><a name="l04244"></a><span class="lineno"> 4244</span>&#160;</div>
<div class="line"><a name="l04245"></a><span class="lineno"> 4245</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l04246"></a><span class="lineno"> 4246</span>&#160;<span class="comment">/*********************************** EFFECTS **********************************/</span></div>
<div class="line"><a name="l04247"></a><span class="lineno"> 4247</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l04248"></a><span class="lineno"> 4248</span>&#160;</div>
<div class="line"><a name="l04249"></a><span class="lineno"> 4249</span>&#160;$.extend($.effects, {</div>
<div class="line"><a name="l04250"></a><span class="lineno"> 4250</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span>,</div>
<div class="line"><a name="l04251"></a><span class="lineno"> 4251</span>&#160;</div>
<div class="line"><a name="l04252"></a><span class="lineno"> 4252</span>&#160;    <span class="comment">// Saves a set of properties in a data storage</span></div>
<div class="line"><a name="l04253"></a><span class="lineno"> 4253</span>&#160;    save: <span class="keyword">function</span>(element, set) {</div>
<div class="line"><a name="l04254"></a><span class="lineno"> 4254</span>&#160;        <span class="keywordflow">for</span>(var i=0; i &lt; set.length; i++) {</div>
<div class="line"><a name="l04255"></a><span class="lineno"> 4255</span>&#160;            <span class="keywordflow">if</span>(set[i] !== null) element.data(<span class="stringliteral">&quot;ec.storage.&quot;</span>+set[i], element[0].style[set[i]]);</div>
<div class="line"><a name="l04256"></a><span class="lineno"> 4256</span>&#160;        }</div>
<div class="line"><a name="l04257"></a><span class="lineno"> 4257</span>&#160;    },</div>
<div class="line"><a name="l04258"></a><span class="lineno"> 4258</span>&#160;</div>
<div class="line"><a name="l04259"></a><span class="lineno"> 4259</span>&#160;    <span class="comment">// Restores a set of previously saved properties from a data storage</span></div>
<div class="line"><a name="l04260"></a><span class="lineno"> 4260</span>&#160;    restore: <span class="keyword">function</span>(element, set) {</div>
<div class="line"><a name="l04261"></a><span class="lineno"> 4261</span>&#160;        <span class="keywordflow">for</span>(var i=0; i &lt; set.length; i++) {</div>
<div class="line"><a name="l04262"></a><span class="lineno"> 4262</span>&#160;            <span class="keywordflow">if</span>(set[i] !== null) element.css(set[i], element.data(<span class="stringliteral">&quot;ec.storage.&quot;</span>+set[i]));</div>
<div class="line"><a name="l04263"></a><span class="lineno"> 4263</span>&#160;        }</div>
<div class="line"><a name="l04264"></a><span class="lineno"> 4264</span>&#160;    },</div>
<div class="line"><a name="l04265"></a><span class="lineno"> 4265</span>&#160;</div>
<div class="line"><a name="l04266"></a><span class="lineno"> 4266</span>&#160;    setMode: <span class="keyword">function</span>(el, mode) {</div>
<div class="line"><a name="l04267"></a><span class="lineno"> 4267</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;toggle&#39;</span>) mode = el.is(<span class="stringliteral">&#39;:hidden&#39;</span>) ? <span class="stringliteral">&#39;show&#39;</span> : <span class="stringliteral">&#39;hide&#39;</span>; <span class="comment">// Set for toggle</span></div>
<div class="line"><a name="l04268"></a><span class="lineno"> 4268</span>&#160;        <span class="keywordflow">return</span> mode;</div>
<div class="line"><a name="l04269"></a><span class="lineno"> 4269</span>&#160;    },</div>
<div class="line"><a name="l04270"></a><span class="lineno"> 4270</span>&#160;</div>
<div class="line"><a name="l04271"></a><span class="lineno"> 4271</span>&#160;    getBaseline: <span class="keyword">function</span>(origin, original) { <span class="comment">// Translates a [top,left] array into a baseline value</span></div>
<div class="line"><a name="l04272"></a><span class="lineno"> 4272</span>&#160;        <span class="comment">// this should be a little more flexible in the future to handle a string &amp; hash</span></div>
<div class="line"><a name="l04273"></a><span class="lineno"> 4273</span>&#160;        var y, x;</div>
<div class="line"><a name="l04274"></a><span class="lineno"> 4274</span>&#160;        <span class="keywordflow">switch</span> (origin[0]) {</div>
<div class="line"><a name="l04275"></a><span class="lineno"> 4275</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&#39;top&#39;</span>: y = 0; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04276"></a><span class="lineno"> 4276</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&#39;middle&#39;</span>: y = 0.5; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04277"></a><span class="lineno"> 4277</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&#39;bottom&#39;</span>: y = 1; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04278"></a><span class="lineno"> 4278</span>&#160;            <span class="keywordflow">default</span>: y = origin[0] / original.height;</div>
<div class="line"><a name="l04279"></a><span class="lineno"> 4279</span>&#160;        };</div>
<div class="line"><a name="l04280"></a><span class="lineno"> 4280</span>&#160;        <span class="keywordflow">switch</span> (origin[1]) {</div>
<div class="line"><a name="l04281"></a><span class="lineno"> 4281</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&#39;left&#39;</span>: x = 0; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04282"></a><span class="lineno"> 4282</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&#39;center&#39;</span>: x = 0.5; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04283"></a><span class="lineno"> 4283</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&#39;right&#39;</span>: x = 1; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04284"></a><span class="lineno"> 4284</span>&#160;            <span class="keywordflow">default</span>: x = origin[1] / original.width;</div>
<div class="line"><a name="l04285"></a><span class="lineno"> 4285</span>&#160;        };</div>
<div class="line"><a name="l04286"></a><span class="lineno"> 4286</span>&#160;        <span class="keywordflow">return</span> {x: x, y: y};</div>
<div class="line"><a name="l04287"></a><span class="lineno"> 4287</span>&#160;    },</div>
<div class="line"><a name="l04288"></a><span class="lineno"> 4288</span>&#160;</div>
<div class="line"><a name="l04289"></a><span class="lineno"> 4289</span>&#160;    <span class="comment">// Wraps the element around a wrapper that copies position properties</span></div>
<div class="line"><a name="l04290"></a><span class="lineno"> 4290</span>&#160;    createWrapper: <span class="keyword">function</span>(element) {</div>
<div class="line"><a name="l04291"></a><span class="lineno"> 4291</span>&#160;</div>
<div class="line"><a name="l04292"></a><span class="lineno"> 4292</span>&#160;        <span class="comment">// if the element is already wrapped, return it</span></div>
<div class="line"><a name="l04293"></a><span class="lineno"> 4293</span>&#160;        <span class="keywordflow">if</span> (element.parent().is(<span class="stringliteral">&#39;.ui-effects-wrapper&#39;</span>)) {</div>
<div class="line"><a name="l04294"></a><span class="lineno"> 4294</span>&#160;            <span class="keywordflow">return</span> element.parent();</div>
<div class="line"><a name="l04295"></a><span class="lineno"> 4295</span>&#160;        }</div>
<div class="line"><a name="l04296"></a><span class="lineno"> 4296</span>&#160;</div>
<div class="line"><a name="l04297"></a><span class="lineno"> 4297</span>&#160;        <span class="comment">// wrap the element</span></div>
<div class="line"><a name="l04298"></a><span class="lineno"> 4298</span>&#160;        var props = {</div>
<div class="line"><a name="l04299"></a><span class="lineno"> 4299</span>&#160;                width: element.outerWidth(<span class="keyword">true</span>),</div>
<div class="line"><a name="l04300"></a><span class="lineno"> 4300</span>&#160;                height: element.outerHeight(<span class="keyword">true</span>),</div>
<div class="line"><a name="l04301"></a><span class="lineno"> 4301</span>&#160;                <span class="stringliteral">&#39;float&#39;</span>: element.css(<span class="stringliteral">&#39;float&#39;</span>)</div>
<div class="line"><a name="l04302"></a><span class="lineno"> 4302</span>&#160;            },</div>
<div class="line"><a name="l04303"></a><span class="lineno"> 4303</span>&#160;            wrapper = $(<span class="stringliteral">&#39;&lt;div&gt;&lt;/div&gt;&#39;</span>)</div>
<div class="line"><a name="l04304"></a><span class="lineno"> 4304</span>&#160;                .addClass(<span class="stringliteral">&#39;ui-effects-wrapper&#39;</span>)</div>
<div class="line"><a name="l04305"></a><span class="lineno"> 4305</span>&#160;                .css({</div>
<div class="line"><a name="l04306"></a><span class="lineno"> 4306</span>&#160;                    fontSize: <span class="stringliteral">&#39;100%&#39;</span>,</div>
<div class="line"><a name="l04307"></a><span class="lineno"> 4307</span>&#160;                    background: <span class="stringliteral">&#39;transparent&#39;</span>,</div>
<div class="line"><a name="l04308"></a><span class="lineno"> 4308</span>&#160;                    border: <span class="stringliteral">&#39;none&#39;</span>,</div>
<div class="line"><a name="l04309"></a><span class="lineno"> 4309</span>&#160;                    margin: 0,</div>
<div class="line"><a name="l04310"></a><span class="lineno"> 4310</span>&#160;                    padding: 0</div>
<div class="line"><a name="l04311"></a><span class="lineno"> 4311</span>&#160;                }),</div>
<div class="line"><a name="l04312"></a><span class="lineno"> 4312</span>&#160;            active = document.activeElement;</div>
<div class="line"><a name="l04313"></a><span class="lineno"> 4313</span>&#160;</div>
<div class="line"><a name="l04314"></a><span class="lineno"> 4314</span>&#160;        element.wrap(wrapper);</div>
<div class="line"><a name="l04315"></a><span class="lineno"> 4315</span>&#160;</div>
<div class="line"><a name="l04316"></a><span class="lineno"> 4316</span>&#160;        <span class="comment">// Fixes #7595 - Elements lose focus when wrapped.</span></div>
<div class="line"><a name="l04317"></a><span class="lineno"> 4317</span>&#160;        <span class="keywordflow">if</span> ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {</div>
<div class="line"><a name="l04318"></a><span class="lineno"> 4318</span>&#160;            $( active ).focus();</div>
<div class="line"><a name="l04319"></a><span class="lineno"> 4319</span>&#160;        }</div>
<div class="line"><a name="l04320"></a><span class="lineno"> 4320</span>&#160;        </div>
<div class="line"><a name="l04321"></a><span class="lineno"> 4321</span>&#160;        wrapper = element.parent(); <span class="comment">//Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element</span></div>
<div class="line"><a name="l04322"></a><span class="lineno"> 4322</span>&#160;</div>
<div class="line"><a name="l04323"></a><span class="lineno"> 4323</span>&#160;        <span class="comment">// transfer positioning properties to the wrapper</span></div>
<div class="line"><a name="l04324"></a><span class="lineno"> 4324</span>&#160;        <span class="keywordflow">if</span> (element.css(<span class="stringliteral">&#39;position&#39;</span>) == <span class="stringliteral">&#39;static&#39;</span>) {</div>
<div class="line"><a name="l04325"></a><span class="lineno"> 4325</span>&#160;            wrapper.css({ position: <span class="stringliteral">&#39;relative&#39;</span> });</div>
<div class="line"><a name="l04326"></a><span class="lineno"> 4326</span>&#160;            element.css({ position: <span class="stringliteral">&#39;relative&#39;</span> });</div>
<div class="line"><a name="l04327"></a><span class="lineno"> 4327</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04328"></a><span class="lineno"> 4328</span>&#160;            $.extend(props, {</div>
<div class="line"><a name="l04329"></a><span class="lineno"> 4329</span>&#160;                position: element.css(<span class="stringliteral">&#39;position&#39;</span>),</div>
<div class="line"><a name="l04330"></a><span class="lineno"> 4330</span>&#160;                zIndex: element.css(<span class="stringliteral">&#39;z-index&#39;</span>)</div>
<div class="line"><a name="l04331"></a><span class="lineno"> 4331</span>&#160;            });</div>
<div class="line"><a name="l04332"></a><span class="lineno"> 4332</span>&#160;            $.each([<span class="stringliteral">&#39;top&#39;</span>, <span class="stringliteral">&#39;left&#39;</span>, <span class="stringliteral">&#39;bottom&#39;</span>, <span class="stringliteral">&#39;right&#39;</span>], <span class="keyword">function</span>(i, pos) {</div>
<div class="line"><a name="l04333"></a><span class="lineno"> 4333</span>&#160;                props[pos] = element.css(pos);</div>
<div class="line"><a name="l04334"></a><span class="lineno"> 4334</span>&#160;                <span class="keywordflow">if</span> (isNaN(parseInt(props[pos], 10))) {</div>
<div class="line"><a name="l04335"></a><span class="lineno"> 4335</span>&#160;                    props[pos] = <span class="stringliteral">&#39;auto&#39;</span>;</div>
<div class="line"><a name="l04336"></a><span class="lineno"> 4336</span>&#160;                }</div>
<div class="line"><a name="l04337"></a><span class="lineno"> 4337</span>&#160;            });</div>
<div class="line"><a name="l04338"></a><span class="lineno"> 4338</span>&#160;            element.css({position: <span class="stringliteral">&#39;relative&#39;</span>, top: 0, left: 0, right: <span class="stringliteral">&#39;auto&#39;</span>, bottom: <span class="stringliteral">&#39;auto&#39;</span> });</div>
<div class="line"><a name="l04339"></a><span class="lineno"> 4339</span>&#160;        }</div>
<div class="line"><a name="l04340"></a><span class="lineno"> 4340</span>&#160;</div>
<div class="line"><a name="l04341"></a><span class="lineno"> 4341</span>&#160;        <span class="keywordflow">return</span> wrapper.css(props).show();</div>
<div class="line"><a name="l04342"></a><span class="lineno"> 4342</span>&#160;    },</div>
<div class="line"><a name="l04343"></a><span class="lineno"> 4343</span>&#160;</div>
<div class="line"><a name="l04344"></a><span class="lineno"> 4344</span>&#160;    removeWrapper: <span class="keyword">function</span>(element) {</div>
<div class="line"><a name="l04345"></a><span class="lineno"> 4345</span>&#160;        var parent,</div>
<div class="line"><a name="l04346"></a><span class="lineno"> 4346</span>&#160;            active = document.activeElement;</div>
<div class="line"><a name="l04347"></a><span class="lineno"> 4347</span>&#160;        </div>
<div class="line"><a name="l04348"></a><span class="lineno"> 4348</span>&#160;        <span class="keywordflow">if</span> (element.parent().is(<span class="stringliteral">&#39;.ui-effects-wrapper&#39;</span>)) {</div>
<div class="line"><a name="l04349"></a><span class="lineno"> 4349</span>&#160;            parent = element.parent().replaceWith(element);</div>
<div class="line"><a name="l04350"></a><span class="lineno"> 4350</span>&#160;            <span class="comment">// Fixes #7595 - Elements lose focus when wrapped.</span></div>
<div class="line"><a name="l04351"></a><span class="lineno"> 4351</span>&#160;            <span class="keywordflow">if</span> ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {</div>
<div class="line"><a name="l04352"></a><span class="lineno"> 4352</span>&#160;                $( active ).focus();</div>
<div class="line"><a name="l04353"></a><span class="lineno"> 4353</span>&#160;            }</div>
<div class="line"><a name="l04354"></a><span class="lineno"> 4354</span>&#160;            <span class="keywordflow">return</span> parent;</div>
<div class="line"><a name="l04355"></a><span class="lineno"> 4355</span>&#160;        }</div>
<div class="line"><a name="l04356"></a><span class="lineno"> 4356</span>&#160;            </div>
<div class="line"><a name="l04357"></a><span class="lineno"> 4357</span>&#160;        <span class="keywordflow">return</span> element;</div>
<div class="line"><a name="l04358"></a><span class="lineno"> 4358</span>&#160;    },</div>
<div class="line"><a name="l04359"></a><span class="lineno"> 4359</span>&#160;</div>
<div class="line"><a name="l04360"></a><span class="lineno"> 4360</span>&#160;    setTransition: <span class="keyword">function</span>(element, list, factor, value) {</div>
<div class="line"><a name="l04361"></a><span class="lineno"> 4361</span>&#160;        value = value || {};</div>
<div class="line"><a name="l04362"></a><span class="lineno"> 4362</span>&#160;        $.each(list, <span class="keyword">function</span>(i, x){</div>
<div class="line"><a name="l04363"></a><span class="lineno"> 4363</span>&#160;            var unit = element.cssUnit(x);</div>
<div class="line"><a name="l04364"></a><span class="lineno"> 4364</span>&#160;            <span class="keywordflow">if</span> (unit[0] &gt; 0) value[x] = unit[0] * factor + unit[1];</div>
<div class="line"><a name="l04365"></a><span class="lineno"> 4365</span>&#160;        });</div>
<div class="line"><a name="l04366"></a><span class="lineno"> 4366</span>&#160;        <span class="keywordflow">return</span> value;</div>
<div class="line"><a name="l04367"></a><span class="lineno"> 4367</span>&#160;    }</div>
<div class="line"><a name="l04368"></a><span class="lineno"> 4368</span>&#160;});</div>
<div class="line"><a name="l04369"></a><span class="lineno"> 4369</span>&#160;</div>
<div class="line"><a name="l04370"></a><span class="lineno"> 4370</span>&#160;</div>
<div class="line"><a name="l04371"></a><span class="lineno"> 4371</span>&#160;<span class="keyword">function</span> _normalizeArguments(effect, options, speed, callback) {</div>
<div class="line"><a name="l04372"></a><span class="lineno"> 4372</span>&#160;    <span class="comment">// shift params for method overloading</span></div>
<div class="line"><a name="l04373"></a><span class="lineno"> 4373</span>&#160;    <span class="keywordflow">if</span> (typeof effect == <span class="stringliteral">&#39;object&#39;</span>) {</div>
<div class="line"><a name="l04374"></a><span class="lineno"> 4374</span>&#160;        callback = options;</div>
<div class="line"><a name="l04375"></a><span class="lineno"> 4375</span>&#160;        speed = null;</div>
<div class="line"><a name="l04376"></a><span class="lineno"> 4376</span>&#160;        options = effect;</div>
<div class="line"><a name="l04377"></a><span class="lineno"> 4377</span>&#160;        effect = options.effect;</div>
<div class="line"><a name="l04378"></a><span class="lineno"> 4378</span>&#160;    }</div>
<div class="line"><a name="l04379"></a><span class="lineno"> 4379</span>&#160;    <span class="keywordflow">if</span> ($.isFunction(options)) {</div>
<div class="line"><a name="l04380"></a><span class="lineno"> 4380</span>&#160;        callback = options;</div>
<div class="line"><a name="l04381"></a><span class="lineno"> 4381</span>&#160;        speed = null;</div>
<div class="line"><a name="l04382"></a><span class="lineno"> 4382</span>&#160;        options = {};</div>
<div class="line"><a name="l04383"></a><span class="lineno"> 4383</span>&#160;    }</div>
<div class="line"><a name="l04384"></a><span class="lineno"> 4384</span>&#160;        <span class="keywordflow">if</span> (typeof options == <span class="stringliteral">&#39;number&#39;</span> || $.fx.speeds[options]) {</div>
<div class="line"><a name="l04385"></a><span class="lineno"> 4385</span>&#160;        callback = speed;</div>
<div class="line"><a name="l04386"></a><span class="lineno"> 4386</span>&#160;        speed = options;</div>
<div class="line"><a name="l04387"></a><span class="lineno"> 4387</span>&#160;        options = {};</div>
<div class="line"><a name="l04388"></a><span class="lineno"> 4388</span>&#160;    }</div>
<div class="line"><a name="l04389"></a><span class="lineno"> 4389</span>&#160;    <span class="keywordflow">if</span> ($.isFunction(speed)) {</div>
<div class="line"><a name="l04390"></a><span class="lineno"> 4390</span>&#160;        callback = speed;</div>
<div class="line"><a name="l04391"></a><span class="lineno"> 4391</span>&#160;        speed = null;</div>
<div class="line"><a name="l04392"></a><span class="lineno"> 4392</span>&#160;    }</div>
<div class="line"><a name="l04393"></a><span class="lineno"> 4393</span>&#160;</div>
<div class="line"><a name="l04394"></a><span class="lineno"> 4394</span>&#160;    options = options || {};</div>
<div class="line"><a name="l04395"></a><span class="lineno"> 4395</span>&#160;</div>
<div class="line"><a name="l04396"></a><span class="lineno"> 4396</span>&#160;    speed = speed || options.duration;</div>
<div class="line"><a name="l04397"></a><span class="lineno"> 4397</span>&#160;    speed = $.fx.off ? 0 : typeof speed == <span class="stringliteral">&#39;number&#39;</span></div>
<div class="line"><a name="l04398"></a><span class="lineno"> 4398</span>&#160;        ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;</div>
<div class="line"><a name="l04399"></a><span class="lineno"> 4399</span>&#160;</div>
<div class="line"><a name="l04400"></a><span class="lineno"> 4400</span>&#160;    callback = callback || options.complete;</div>
<div class="line"><a name="l04401"></a><span class="lineno"> 4401</span>&#160;</div>
<div class="line"><a name="l04402"></a><span class="lineno"> 4402</span>&#160;    <span class="keywordflow">return</span> [effect, options, speed, callback];</div>
<div class="line"><a name="l04403"></a><span class="lineno"> 4403</span>&#160;}</div>
<div class="line"><a name="l04404"></a><span class="lineno"> 4404</span>&#160;</div>
<div class="line"><a name="l04405"></a><span class="lineno"> 4405</span>&#160;<span class="keyword">function</span> standardSpeed( speed ) {</div>
<div class="line"><a name="l04406"></a><span class="lineno"> 4406</span>&#160;    <span class="comment">// valid standard speeds</span></div>
<div class="line"><a name="l04407"></a><span class="lineno"> 4407</span>&#160;    <span class="keywordflow">if</span> ( !speed || typeof speed === <span class="stringliteral">&quot;number&quot;</span> || $.fx.speeds[ speed ] ) {</div>
<div class="line"><a name="l04408"></a><span class="lineno"> 4408</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l04409"></a><span class="lineno"> 4409</span>&#160;    }</div>
<div class="line"><a name="l04410"></a><span class="lineno"> 4410</span>&#160;    </div>
<div class="line"><a name="l04411"></a><span class="lineno"> 4411</span>&#160;    <span class="comment">// invalid strings - treat as &quot;normal&quot; speed</span></div>
<div class="line"><a name="l04412"></a><span class="lineno"> 4412</span>&#160;    <span class="keywordflow">if</span> ( typeof speed === <span class="stringliteral">&quot;string&quot;</span> &amp;&amp; !$.effects[ speed ] ) {</div>
<div class="line"><a name="l04413"></a><span class="lineno"> 4413</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l04414"></a><span class="lineno"> 4414</span>&#160;    }</div>
<div class="line"><a name="l04415"></a><span class="lineno"> 4415</span>&#160;    </div>
<div class="line"><a name="l04416"></a><span class="lineno"> 4416</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l04417"></a><span class="lineno"> 4417</span>&#160;}</div>
<div class="line"><a name="l04418"></a><span class="lineno"> 4418</span>&#160;</div>
<div class="line"><a name="l04419"></a><span class="lineno"> 4419</span>&#160;$.fn.extend({</div>
<div class="line"><a name="l04420"></a><span class="lineno"> 4420</span>&#160;    effect: <span class="keyword">function</span>(effect, options, speed, callback) {</div>
<div class="line"><a name="l04421"></a><span class="lineno"> 4421</span>&#160;        var args = _normalizeArguments.apply(<span class="keyword">this</span>, arguments),</div>
<div class="line"><a name="l04422"></a><span class="lineno"> 4422</span>&#160;            <span class="comment">// TODO: make effects take actual parameters instead of a hash</span></div>
<div class="line"><a name="l04423"></a><span class="lineno"> 4423</span>&#160;            args2 = {</div>
<div class="line"><a name="l04424"></a><span class="lineno"> 4424</span>&#160;                options: args[1],</div>
<div class="line"><a name="l04425"></a><span class="lineno"> 4425</span>&#160;                duration: args[2],</div>
<div class="line"><a name="l04426"></a><span class="lineno"> 4426</span>&#160;                callback: args[3]</div>
<div class="line"><a name="l04427"></a><span class="lineno"> 4427</span>&#160;            },</div>
<div class="line"><a name="l04428"></a><span class="lineno"> 4428</span>&#160;            mode = args2.options.mode,</div>
<div class="line"><a name="l04429"></a><span class="lineno"> 4429</span>&#160;            effectMethod = $.effects[effect];</div>
<div class="line"><a name="l04430"></a><span class="lineno"> 4430</span>&#160;        </div>
<div class="line"><a name="l04431"></a><span class="lineno"> 4431</span>&#160;        <span class="keywordflow">if</span> ( $.fx.off || !effectMethod ) {</div>
<div class="line"><a name="l04432"></a><span class="lineno"> 4432</span>&#160;            <span class="comment">// delegate to the original method (e.g., .show()) if possible</span></div>
<div class="line"><a name="l04433"></a><span class="lineno"> 4433</span>&#160;            <span class="keywordflow">if</span> ( mode ) {</div>
<div class="line"><a name="l04434"></a><span class="lineno"> 4434</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">this</span>[ mode ]( args2.duration, args2.callback );</div>
<div class="line"><a name="l04435"></a><span class="lineno"> 4435</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04436"></a><span class="lineno"> 4436</span>&#160;                <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04437"></a><span class="lineno"> 4437</span>&#160;                    <span class="keywordflow">if</span> ( args2.callback ) {</div>
<div class="line"><a name="l04438"></a><span class="lineno"> 4438</span>&#160;                        args2.callback.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l04439"></a><span class="lineno"> 4439</span>&#160;                    }</div>
<div class="line"><a name="l04440"></a><span class="lineno"> 4440</span>&#160;                });</div>
<div class="line"><a name="l04441"></a><span class="lineno"> 4441</span>&#160;            }</div>
<div class="line"><a name="l04442"></a><span class="lineno"> 4442</span>&#160;        }</div>
<div class="line"><a name="l04443"></a><span class="lineno"> 4443</span>&#160;        </div>
<div class="line"><a name="l04444"></a><span class="lineno"> 4444</span>&#160;        <span class="keywordflow">return</span> effectMethod.call(<span class="keyword">this</span>, args2);</div>
<div class="line"><a name="l04445"></a><span class="lineno"> 4445</span>&#160;    },</div>
<div class="line"><a name="l04446"></a><span class="lineno"> 4446</span>&#160;</div>
<div class="line"><a name="l04447"></a><span class="lineno"> 4447</span>&#160;    _show: $.fn.show,</div>
<div class="line"><a name="l04448"></a><span class="lineno"> 4448</span>&#160;    show: <span class="keyword">function</span>(speed) {</div>
<div class="line"><a name="l04449"></a><span class="lineno"> 4449</span>&#160;        <span class="keywordflow">if</span> ( standardSpeed( speed ) ) {</div>
<div class="line"><a name="l04450"></a><span class="lineno"> 4450</span>&#160;            <span class="keywordflow">return</span> this._show.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l04451"></a><span class="lineno"> 4451</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04452"></a><span class="lineno"> 4452</span>&#160;            var args = _normalizeArguments.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l04453"></a><span class="lineno"> 4453</span>&#160;            args[1].mode = <span class="stringliteral">&#39;show&#39;</span>;</div>
<div class="line"><a name="l04454"></a><span class="lineno"> 4454</span>&#160;            <span class="keywordflow">return</span> this.effect.apply(<span class="keyword">this</span>, args);</div>
<div class="line"><a name="l04455"></a><span class="lineno"> 4455</span>&#160;        }</div>
<div class="line"><a name="l04456"></a><span class="lineno"> 4456</span>&#160;    },</div>
<div class="line"><a name="l04457"></a><span class="lineno"> 4457</span>&#160;</div>
<div class="line"><a name="l04458"></a><span class="lineno"> 4458</span>&#160;    _hide: $.fn.hide,</div>
<div class="line"><a name="l04459"></a><span class="lineno"> 4459</span>&#160;    hide: <span class="keyword">function</span>(speed) {</div>
<div class="line"><a name="l04460"></a><span class="lineno"> 4460</span>&#160;        <span class="keywordflow">if</span> ( standardSpeed( speed ) ) {</div>
<div class="line"><a name="l04461"></a><span class="lineno"> 4461</span>&#160;            <span class="keywordflow">return</span> this._hide.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l04462"></a><span class="lineno"> 4462</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04463"></a><span class="lineno"> 4463</span>&#160;            var args = _normalizeArguments.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l04464"></a><span class="lineno"> 4464</span>&#160;            args[1].mode = <span class="stringliteral">&#39;hide&#39;</span>;</div>
<div class="line"><a name="l04465"></a><span class="lineno"> 4465</span>&#160;            <span class="keywordflow">return</span> this.effect.apply(<span class="keyword">this</span>, args);</div>
<div class="line"><a name="l04466"></a><span class="lineno"> 4466</span>&#160;        }</div>
<div class="line"><a name="l04467"></a><span class="lineno"> 4467</span>&#160;    },</div>
<div class="line"><a name="l04468"></a><span class="lineno"> 4468</span>&#160;</div>
<div class="line"><a name="l04469"></a><span class="lineno"> 4469</span>&#160;    <span class="comment">// jQuery core overloads toggle and creates _toggle</span></div>
<div class="line"><a name="l04470"></a><span class="lineno"> 4470</span>&#160;    __toggle: $.fn.toggle,</div>
<div class="line"><a name="l04471"></a><span class="lineno"> 4471</span>&#160;    toggle: <span class="keyword">function</span>(speed) {</div>
<div class="line"><a name="l04472"></a><span class="lineno"> 4472</span>&#160;        <span class="keywordflow">if</span> ( standardSpeed( speed ) || typeof speed === <span class="stringliteral">&quot;boolean&quot;</span> || $.isFunction( speed ) ) {</div>
<div class="line"><a name="l04473"></a><span class="lineno"> 4473</span>&#160;            <span class="keywordflow">return</span> this.__toggle.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l04474"></a><span class="lineno"> 4474</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04475"></a><span class="lineno"> 4475</span>&#160;            var args = _normalizeArguments.apply(<span class="keyword">this</span>, arguments);</div>
<div class="line"><a name="l04476"></a><span class="lineno"> 4476</span>&#160;            args[1].mode = <span class="stringliteral">&#39;toggle&#39;</span>;</div>
<div class="line"><a name="l04477"></a><span class="lineno"> 4477</span>&#160;            <span class="keywordflow">return</span> this.effect.apply(<span class="keyword">this</span>, args);</div>
<div class="line"><a name="l04478"></a><span class="lineno"> 4478</span>&#160;        }</div>
<div class="line"><a name="l04479"></a><span class="lineno"> 4479</span>&#160;    },</div>
<div class="line"><a name="l04480"></a><span class="lineno"> 4480</span>&#160;</div>
<div class="line"><a name="l04481"></a><span class="lineno"> 4481</span>&#160;    <span class="comment">// helper functions</span></div>
<div class="line"><a name="l04482"></a><span class="lineno"> 4482</span>&#160;    cssUnit: <span class="keyword">function</span>(key) {</div>
<div class="line"><a name="l04483"></a><span class="lineno"> 4483</span>&#160;        var style = this.css(key), val = [];</div>
<div class="line"><a name="l04484"></a><span class="lineno"> 4484</span>&#160;        $.each( [<span class="stringliteral">&#39;em&#39;</span>,<span class="stringliteral">&#39;px&#39;</span>,<span class="charliteral">&#39;%&#39;</span>,<span class="stringliteral">&#39;pt&#39;</span>], <span class="keyword">function</span>(i, unit){</div>
<div class="line"><a name="l04485"></a><span class="lineno"> 4485</span>&#160;            <span class="keywordflow">if</span>(style.indexOf(unit) &gt; 0)</div>
<div class="line"><a name="l04486"></a><span class="lineno"> 4486</span>&#160;                val = [parseFloat(style), unit];</div>
<div class="line"><a name="l04487"></a><span class="lineno"> 4487</span>&#160;        });</div>
<div class="line"><a name="l04488"></a><span class="lineno"> 4488</span>&#160;        <span class="keywordflow">return</span> val;</div>
<div class="line"><a name="l04489"></a><span class="lineno"> 4489</span>&#160;    }</div>
<div class="line"><a name="l04490"></a><span class="lineno"> 4490</span>&#160;});</div>
<div class="line"><a name="l04491"></a><span class="lineno"> 4491</span>&#160;</div>
<div class="line"><a name="l04492"></a><span class="lineno"> 4492</span>&#160;</div>
<div class="line"><a name="l04493"></a><span class="lineno"> 4493</span>&#160;</div>
<div class="line"><a name="l04494"></a><span class="lineno"> 4494</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l04495"></a><span class="lineno"> 4495</span>&#160;<span class="comment">/*********************************** EASING ***********************************/</span></div>
<div class="line"><a name="l04496"></a><span class="lineno"> 4496</span>&#160;<span class="comment">/******************************************************************************/</span></div>
<div class="line"><a name="l04497"></a><span class="lineno"> 4497</span>&#160;</div>
<div class="line"><a name="l04498"></a><span class="lineno"> 4498</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l04499"></a><span class="lineno"> 4499</span>&#160;<span class="comment"> * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/</span></div>
<div class="line"><a name="l04500"></a><span class="lineno"> 4500</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04501"></a><span class="lineno"> 4501</span>&#160;<span class="comment"> * Uses the built in easing capabilities added In jQuery 1.1</span></div>
<div class="line"><a name="l04502"></a><span class="lineno"> 4502</span>&#160;<span class="comment"> * to offer multiple easing options</span></div>
<div class="line"><a name="l04503"></a><span class="lineno"> 4503</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04504"></a><span class="lineno"> 4504</span>&#160;<span class="comment"> * TERMS OF USE - jQuery Easing</span></div>
<div class="line"><a name="l04505"></a><span class="lineno"> 4505</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04506"></a><span class="lineno"> 4506</span>&#160;<span class="comment"> * Open source under the BSD License.</span></div>
<div class="line"><a name="l04507"></a><span class="lineno"> 4507</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04508"></a><span class="lineno"> 4508</span>&#160;<span class="comment"> * Copyright 2008 George McGinley Smith</span></div>
<div class="line"><a name="l04509"></a><span class="lineno"> 4509</span>&#160;<span class="comment"> * All rights reserved.</span></div>
<div class="line"><a name="l04510"></a><span class="lineno"> 4510</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04511"></a><span class="lineno"> 4511</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without modification,</span></div>
<div class="line"><a name="l04512"></a><span class="lineno"> 4512</span>&#160;<span class="comment"> * are permitted provided that the following conditions are met:</span></div>
<div class="line"><a name="l04513"></a><span class="lineno"> 4513</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04514"></a><span class="lineno"> 4514</span>&#160;<span class="comment"> * Redistributions of source code must retain the above copyright notice, this list of</span></div>
<div class="line"><a name="l04515"></a><span class="lineno"> 4515</span>&#160;<span class="comment"> * conditions and the following disclaimer.</span></div>
<div class="line"><a name="l04516"></a><span class="lineno"> 4516</span>&#160;<span class="comment"> * Redistributions in binary form must reproduce the above copyright notice, this list</span></div>
<div class="line"><a name="l04517"></a><span class="lineno"> 4517</span>&#160;<span class="comment"> * of conditions and the following disclaimer in the documentation and/or other materials</span></div>
<div class="line"><a name="l04518"></a><span class="lineno"> 4518</span>&#160;<span class="comment"> * provided with the distribution.</span></div>
<div class="line"><a name="l04519"></a><span class="lineno"> 4519</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04520"></a><span class="lineno"> 4520</span>&#160;<span class="comment"> * Neither the name of the author nor the names of contributors may be used to endorse</span></div>
<div class="line"><a name="l04521"></a><span class="lineno"> 4521</span>&#160;<span class="comment"> * or promote products derived from this software without specific prior written permission.</span></div>
<div class="line"><a name="l04522"></a><span class="lineno"> 4522</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04523"></a><span class="lineno"> 4523</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY</span></div>
<div class="line"><a name="l04524"></a><span class="lineno"> 4524</span>&#160;<span class="comment"> * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span></div>
<div class="line"><a name="l04525"></a><span class="lineno"> 4525</span>&#160;<span class="comment"> * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span></div>
<div class="line"><a name="l04526"></a><span class="lineno"> 4526</span>&#160;<span class="comment"> * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div>
<div class="line"><a name="l04527"></a><span class="lineno"> 4527</span>&#160;<span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span></div>
<div class="line"><a name="l04528"></a><span class="lineno"> 4528</span>&#160;<span class="comment"> * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED</span></div>
<div class="line"><a name="l04529"></a><span class="lineno"> 4529</span>&#160;<span class="comment"> * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span></div>
<div class="line"><a name="l04530"></a><span class="lineno"> 4530</span>&#160;<span class="comment"> * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED</span></div>
<div class="line"><a name="l04531"></a><span class="lineno"> 4531</span>&#160;<span class="comment"> * OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l04532"></a><span class="lineno"> 4532</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04533"></a><span class="lineno"> 4533</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l04534"></a><span class="lineno"> 4534</span>&#160;</div>
<div class="line"><a name="l04535"></a><span class="lineno"> 4535</span>&#160;<span class="comment">// t: current time, b: begInnIng value, c: change In value, d: duration</span></div>
<div class="line"><a name="l04536"></a><span class="lineno"> 4536</span>&#160;$.easing.jswing = $.easing.swing;</div>
<div class="line"><a name="l04537"></a><span class="lineno"> 4537</span>&#160;</div>
<div class="line"><a name="l04538"></a><span class="lineno"> 4538</span>&#160;$.extend($.easing,</div>
<div class="line"><a name="l04539"></a><span class="lineno"> 4539</span>&#160;{</div>
<div class="line"><a name="l04540"></a><span class="lineno"> 4540</span>&#160;    def: <span class="stringliteral">&#39;easeOutQuad&#39;</span>,</div>
<div class="line"><a name="l04541"></a><span class="lineno"> 4541</span>&#160;    swing: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04542"></a><span class="lineno"> 4542</span>&#160;        <span class="comment">//alert($.easing.default);</span></div>
<div class="line"><a name="l04543"></a><span class="lineno"> 4543</span>&#160;        <span class="keywordflow">return</span> $.easing[$.easing.def](x, t, b, c, d);</div>
<div class="line"><a name="l04544"></a><span class="lineno"> 4544</span>&#160;    },</div>
<div class="line"><a name="l04545"></a><span class="lineno"> 4545</span>&#160;    easeInQuad: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04546"></a><span class="lineno"> 4546</span>&#160;        <span class="keywordflow">return</span> c*(t/=d)*t + b;</div>
<div class="line"><a name="l04547"></a><span class="lineno"> 4547</span>&#160;    },</div>
<div class="line"><a name="l04548"></a><span class="lineno"> 4548</span>&#160;    easeOutQuad: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04549"></a><span class="lineno"> 4549</span>&#160;        <span class="keywordflow">return</span> -c *(t/=d)*(t-2) + b;</div>
<div class="line"><a name="l04550"></a><span class="lineno"> 4550</span>&#160;    },</div>
<div class="line"><a name="l04551"></a><span class="lineno"> 4551</span>&#160;    easeInOutQuad: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04552"></a><span class="lineno"> 4552</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> c/2*t*t + b;</div>
<div class="line"><a name="l04553"></a><span class="lineno"> 4553</span>&#160;        <span class="keywordflow">return</span> -c/2 * ((--t)*(t-2) - 1) + b;</div>
<div class="line"><a name="l04554"></a><span class="lineno"> 4554</span>&#160;    },</div>
<div class="line"><a name="l04555"></a><span class="lineno"> 4555</span>&#160;    easeInCubic: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04556"></a><span class="lineno"> 4556</span>&#160;        <span class="keywordflow">return</span> c*(t/=d)*t*t + b;</div>
<div class="line"><a name="l04557"></a><span class="lineno"> 4557</span>&#160;    },</div>
<div class="line"><a name="l04558"></a><span class="lineno"> 4558</span>&#160;    easeOutCubic: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04559"></a><span class="lineno"> 4559</span>&#160;        <span class="keywordflow">return</span> c*((t=t/d-1)*t*t + 1) + b;</div>
<div class="line"><a name="l04560"></a><span class="lineno"> 4560</span>&#160;    },</div>
<div class="line"><a name="l04561"></a><span class="lineno"> 4561</span>&#160;    easeInOutCubic: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04562"></a><span class="lineno"> 4562</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> c/2*t*t*t + b;</div>
<div class="line"><a name="l04563"></a><span class="lineno"> 4563</span>&#160;        <span class="keywordflow">return</span> c/2*((t-=2)*t*t + 2) + b;</div>
<div class="line"><a name="l04564"></a><span class="lineno"> 4564</span>&#160;    },</div>
<div class="line"><a name="l04565"></a><span class="lineno"> 4565</span>&#160;    easeInQuart: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04566"></a><span class="lineno"> 4566</span>&#160;        <span class="keywordflow">return</span> c*(t/=d)*t*t*t + b;</div>
<div class="line"><a name="l04567"></a><span class="lineno"> 4567</span>&#160;    },</div>
<div class="line"><a name="l04568"></a><span class="lineno"> 4568</span>&#160;    easeOutQuart: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04569"></a><span class="lineno"> 4569</span>&#160;        <span class="keywordflow">return</span> -c * ((t=t/d-1)*t*t*t - 1) + b;</div>
<div class="line"><a name="l04570"></a><span class="lineno"> 4570</span>&#160;    },</div>
<div class="line"><a name="l04571"></a><span class="lineno"> 4571</span>&#160;    easeInOutQuart: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04572"></a><span class="lineno"> 4572</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> c/2*t*t*t*t + b;</div>
<div class="line"><a name="l04573"></a><span class="lineno"> 4573</span>&#160;        <span class="keywordflow">return</span> -c/2 * ((t-=2)*t*t*t - 2) + b;</div>
<div class="line"><a name="l04574"></a><span class="lineno"> 4574</span>&#160;    },</div>
<div class="line"><a name="l04575"></a><span class="lineno"> 4575</span>&#160;    easeInQuint: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04576"></a><span class="lineno"> 4576</span>&#160;        <span class="keywordflow">return</span> c*(t/=d)*t*t*t*t + b;</div>
<div class="line"><a name="l04577"></a><span class="lineno"> 4577</span>&#160;    },</div>
<div class="line"><a name="l04578"></a><span class="lineno"> 4578</span>&#160;    easeOutQuint: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04579"></a><span class="lineno"> 4579</span>&#160;        <span class="keywordflow">return</span> c*((t=t/d-1)*t*t*t*t + 1) + b;</div>
<div class="line"><a name="l04580"></a><span class="lineno"> 4580</span>&#160;    },</div>
<div class="line"><a name="l04581"></a><span class="lineno"> 4581</span>&#160;    easeInOutQuint: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04582"></a><span class="lineno"> 4582</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> c/2*t*t*t*t*t + b;</div>
<div class="line"><a name="l04583"></a><span class="lineno"> 4583</span>&#160;        <span class="keywordflow">return</span> c/2*((t-=2)*t*t*t*t + 2) + b;</div>
<div class="line"><a name="l04584"></a><span class="lineno"> 4584</span>&#160;    },</div>
<div class="line"><a name="l04585"></a><span class="lineno"> 4585</span>&#160;    easeInSine: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04586"></a><span class="lineno"> 4586</span>&#160;        <span class="keywordflow">return</span> -c * Math.cos(t/d * (Math.PI/2)) + c + b;</div>
<div class="line"><a name="l04587"></a><span class="lineno"> 4587</span>&#160;    },</div>
<div class="line"><a name="l04588"></a><span class="lineno"> 4588</span>&#160;    easeOutSine: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04589"></a><span class="lineno"> 4589</span>&#160;        <span class="keywordflow">return</span> c * Math.sin(t/d * (Math.PI/2)) + b;</div>
<div class="line"><a name="l04590"></a><span class="lineno"> 4590</span>&#160;    },</div>
<div class="line"><a name="l04591"></a><span class="lineno"> 4591</span>&#160;    easeInOutSine: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04592"></a><span class="lineno"> 4592</span>&#160;        <span class="keywordflow">return</span> -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;</div>
<div class="line"><a name="l04593"></a><span class="lineno"> 4593</span>&#160;    },</div>
<div class="line"><a name="l04594"></a><span class="lineno"> 4594</span>&#160;    easeInExpo: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04595"></a><span class="lineno"> 4595</span>&#160;        <span class="keywordflow">return</span> (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;</div>
<div class="line"><a name="l04596"></a><span class="lineno"> 4596</span>&#160;    },</div>
<div class="line"><a name="l04597"></a><span class="lineno"> 4597</span>&#160;    easeOutExpo: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04598"></a><span class="lineno"> 4598</span>&#160;        <span class="keywordflow">return</span> (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;</div>
<div class="line"><a name="l04599"></a><span class="lineno"> 4599</span>&#160;    },</div>
<div class="line"><a name="l04600"></a><span class="lineno"> 4600</span>&#160;    easeInOutExpo: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04601"></a><span class="lineno"> 4601</span>&#160;        <span class="keywordflow">if</span> (t==0) <span class="keywordflow">return</span> b;</div>
<div class="line"><a name="l04602"></a><span class="lineno"> 4602</span>&#160;        <span class="keywordflow">if</span> (t==d) <span class="keywordflow">return</span> b+c;</div>
<div class="line"><a name="l04603"></a><span class="lineno"> 4603</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> c/2 * Math.pow(2, 10 * (t - 1)) + b;</div>
<div class="line"><a name="l04604"></a><span class="lineno"> 4604</span>&#160;        <span class="keywordflow">return</span> c/2 * (-Math.pow(2, -10 * --t) + 2) + b;</div>
<div class="line"><a name="l04605"></a><span class="lineno"> 4605</span>&#160;    },</div>
<div class="line"><a name="l04606"></a><span class="lineno"> 4606</span>&#160;    easeInCirc: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04607"></a><span class="lineno"> 4607</span>&#160;        <span class="keywordflow">return</span> -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;</div>
<div class="line"><a name="l04608"></a><span class="lineno"> 4608</span>&#160;    },</div>
<div class="line"><a name="l04609"></a><span class="lineno"> 4609</span>&#160;    easeOutCirc: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04610"></a><span class="lineno"> 4610</span>&#160;        <span class="keywordflow">return</span> c * Math.sqrt(1 - (t=t/d-1)*t) + b;</div>
<div class="line"><a name="l04611"></a><span class="lineno"> 4611</span>&#160;    },</div>
<div class="line"><a name="l04612"></a><span class="lineno"> 4612</span>&#160;    easeInOutCirc: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04613"></a><span class="lineno"> 4613</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> -c/2 * (Math.sqrt(1 - t*t) - 1) + b;</div>
<div class="line"><a name="l04614"></a><span class="lineno"> 4614</span>&#160;        <span class="keywordflow">return</span> c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;</div>
<div class="line"><a name="l04615"></a><span class="lineno"> 4615</span>&#160;    },</div>
<div class="line"><a name="l04616"></a><span class="lineno"> 4616</span>&#160;    easeInElastic: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04617"></a><span class="lineno"> 4617</span>&#160;        var s=1.70158;var p=0;var a=c;</div>
<div class="line"><a name="l04618"></a><span class="lineno"> 4618</span>&#160;        <span class="keywordflow">if</span> (t==0) <span class="keywordflow">return</span> b;  <span class="keywordflow">if</span> ((t/=d)==1) <span class="keywordflow">return</span> b+c;  <span class="keywordflow">if</span> (!p) p=d*.3;</div>
<div class="line"><a name="l04619"></a><span class="lineno"> 4619</span>&#160;        <span class="keywordflow">if</span> (a &lt; Math.abs(c)) { a=c; var s=p/4; }</div>
<div class="line"><a name="l04620"></a><span class="lineno"> 4620</span>&#160;        <span class="keywordflow">else</span> var s = p/(2*Math.PI) * Math.asin (c/a);</div>
<div class="line"><a name="l04621"></a><span class="lineno"> 4621</span>&#160;        <span class="keywordflow">return</span> -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;</div>
<div class="line"><a name="l04622"></a><span class="lineno"> 4622</span>&#160;    },</div>
<div class="line"><a name="l04623"></a><span class="lineno"> 4623</span>&#160;    easeOutElastic: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04624"></a><span class="lineno"> 4624</span>&#160;        var s=1.70158;var p=0;var a=c;</div>
<div class="line"><a name="l04625"></a><span class="lineno"> 4625</span>&#160;        <span class="keywordflow">if</span> (t==0) <span class="keywordflow">return</span> b;  <span class="keywordflow">if</span> ((t/=d)==1) <span class="keywordflow">return</span> b+c;  <span class="keywordflow">if</span> (!p) p=d*.3;</div>
<div class="line"><a name="l04626"></a><span class="lineno"> 4626</span>&#160;        <span class="keywordflow">if</span> (a &lt; Math.abs(c)) { a=c; var s=p/4; }</div>
<div class="line"><a name="l04627"></a><span class="lineno"> 4627</span>&#160;        <span class="keywordflow">else</span> var s = p/(2*Math.PI) * Math.asin (c/a);</div>
<div class="line"><a name="l04628"></a><span class="lineno"> 4628</span>&#160;        <span class="keywordflow">return</span> a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;</div>
<div class="line"><a name="l04629"></a><span class="lineno"> 4629</span>&#160;    },</div>
<div class="line"><a name="l04630"></a><span class="lineno"> 4630</span>&#160;    easeInOutElastic: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04631"></a><span class="lineno"> 4631</span>&#160;        var s=1.70158;var p=0;var a=c;</div>
<div class="line"><a name="l04632"></a><span class="lineno"> 4632</span>&#160;        <span class="keywordflow">if</span> (t==0) <span class="keywordflow">return</span> b;  <span class="keywordflow">if</span> ((t/=d/2)==2) <span class="keywordflow">return</span> b+c;  <span class="keywordflow">if</span> (!p) p=d*(.3*1.5);</div>
<div class="line"><a name="l04633"></a><span class="lineno"> 4633</span>&#160;        <span class="keywordflow">if</span> (a &lt; Math.abs(c)) { a=c; var s=p/4; }</div>
<div class="line"><a name="l04634"></a><span class="lineno"> 4634</span>&#160;        <span class="keywordflow">else</span> var s = p/(2*Math.PI) * Math.asin (c/a);</div>
<div class="line"><a name="l04635"></a><span class="lineno"> 4635</span>&#160;        <span class="keywordflow">if</span> (t &lt; 1) <span class="keywordflow">return</span> -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;</div>
<div class="line"><a name="l04636"></a><span class="lineno"> 4636</span>&#160;        <span class="keywordflow">return</span> a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;</div>
<div class="line"><a name="l04637"></a><span class="lineno"> 4637</span>&#160;    },</div>
<div class="line"><a name="l04638"></a><span class="lineno"> 4638</span>&#160;    easeInBack: <span class="keyword">function</span> (x, t, b, c, d, s) {</div>
<div class="line"><a name="l04639"></a><span class="lineno"> 4639</span>&#160;        <span class="keywordflow">if</span> (s == undefined) s = 1.70158;</div>
<div class="line"><a name="l04640"></a><span class="lineno"> 4640</span>&#160;        <span class="keywordflow">return</span> c*(t/=d)*t*((s+1)*t - s) + b;</div>
<div class="line"><a name="l04641"></a><span class="lineno"> 4641</span>&#160;    },</div>
<div class="line"><a name="l04642"></a><span class="lineno"> 4642</span>&#160;    easeOutBack: <span class="keyword">function</span> (x, t, b, c, d, s) {</div>
<div class="line"><a name="l04643"></a><span class="lineno"> 4643</span>&#160;        <span class="keywordflow">if</span> (s == undefined) s = 1.70158;</div>
<div class="line"><a name="l04644"></a><span class="lineno"> 4644</span>&#160;        <span class="keywordflow">return</span> c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;</div>
<div class="line"><a name="l04645"></a><span class="lineno"> 4645</span>&#160;    },</div>
<div class="line"><a name="l04646"></a><span class="lineno"> 4646</span>&#160;    easeInOutBack: <span class="keyword">function</span> (x, t, b, c, d, s) {</div>
<div class="line"><a name="l04647"></a><span class="lineno"> 4647</span>&#160;        <span class="keywordflow">if</span> (s == undefined) s = 1.70158;</div>
<div class="line"><a name="l04648"></a><span class="lineno"> 4648</span>&#160;        <span class="keywordflow">if</span> ((t/=d/2) &lt; 1) <span class="keywordflow">return</span> c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;</div>
<div class="line"><a name="l04649"></a><span class="lineno"> 4649</span>&#160;        <span class="keywordflow">return</span> c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;</div>
<div class="line"><a name="l04650"></a><span class="lineno"> 4650</span>&#160;    },</div>
<div class="line"><a name="l04651"></a><span class="lineno"> 4651</span>&#160;    easeInBounce: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04652"></a><span class="lineno"> 4652</span>&#160;        <span class="keywordflow">return</span> c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;</div>
<div class="line"><a name="l04653"></a><span class="lineno"> 4653</span>&#160;    },</div>
<div class="line"><a name="l04654"></a><span class="lineno"> 4654</span>&#160;    easeOutBounce: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04655"></a><span class="lineno"> 4655</span>&#160;        <span class="keywordflow">if</span> ((t/=d) &lt; (1/2.75)) {</div>
<div class="line"><a name="l04656"></a><span class="lineno"> 4656</span>&#160;            <span class="keywordflow">return</span> c*(7.5625*t*t) + b;</div>
<div class="line"><a name="l04657"></a><span class="lineno"> 4657</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (t &lt; (2/2.75)) {</div>
<div class="line"><a name="l04658"></a><span class="lineno"> 4658</span>&#160;            <span class="keywordflow">return</span> c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;</div>
<div class="line"><a name="l04659"></a><span class="lineno"> 4659</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (t &lt; (2.5/2.75)) {</div>
<div class="line"><a name="l04660"></a><span class="lineno"> 4660</span>&#160;            <span class="keywordflow">return</span> c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;</div>
<div class="line"><a name="l04661"></a><span class="lineno"> 4661</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04662"></a><span class="lineno"> 4662</span>&#160;            <span class="keywordflow">return</span> c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;</div>
<div class="line"><a name="l04663"></a><span class="lineno"> 4663</span>&#160;        }</div>
<div class="line"><a name="l04664"></a><span class="lineno"> 4664</span>&#160;    },</div>
<div class="line"><a name="l04665"></a><span class="lineno"> 4665</span>&#160;    easeInOutBounce: <span class="keyword">function</span> (x, t, b, c, d) {</div>
<div class="line"><a name="l04666"></a><span class="lineno"> 4666</span>&#160;        <span class="keywordflow">if</span> (t &lt; d/2) <span class="keywordflow">return</span> $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;</div>
<div class="line"><a name="l04667"></a><span class="lineno"> 4667</span>&#160;        <span class="keywordflow">return</span> $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;</div>
<div class="line"><a name="l04668"></a><span class="lineno"> 4668</span>&#160;    }</div>
<div class="line"><a name="l04669"></a><span class="lineno"> 4669</span>&#160;});</div>
<div class="line"><a name="l04670"></a><span class="lineno"> 4670</span>&#160;</div>
<div class="line"><a name="l04671"></a><span class="lineno"> 4671</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l04672"></a><span class="lineno"> 4672</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04673"></a><span class="lineno"> 4673</span>&#160;<span class="comment"> * TERMS OF USE - EASING EQUATIONS</span></div>
<div class="line"><a name="l04674"></a><span class="lineno"> 4674</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04675"></a><span class="lineno"> 4675</span>&#160;<span class="comment"> * Open source under the BSD License.</span></div>
<div class="line"><a name="l04676"></a><span class="lineno"> 4676</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04677"></a><span class="lineno"> 4677</span>&#160;<span class="comment"> * Copyright 2001 Robert Penner</span></div>
<div class="line"><a name="l04678"></a><span class="lineno"> 4678</span>&#160;<span class="comment"> * All rights reserved.</span></div>
<div class="line"><a name="l04679"></a><span class="lineno"> 4679</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04680"></a><span class="lineno"> 4680</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without modification,</span></div>
<div class="line"><a name="l04681"></a><span class="lineno"> 4681</span>&#160;<span class="comment"> * are permitted provided that the following conditions are met:</span></div>
<div class="line"><a name="l04682"></a><span class="lineno"> 4682</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04683"></a><span class="lineno"> 4683</span>&#160;<span class="comment"> * Redistributions of source code must retain the above copyright notice, this list of</span></div>
<div class="line"><a name="l04684"></a><span class="lineno"> 4684</span>&#160;<span class="comment"> * conditions and the following disclaimer.</span></div>
<div class="line"><a name="l04685"></a><span class="lineno"> 4685</span>&#160;<span class="comment"> * Redistributions in binary form must reproduce the above copyright notice, this list</span></div>
<div class="line"><a name="l04686"></a><span class="lineno"> 4686</span>&#160;<span class="comment"> * of conditions and the following disclaimer in the documentation and/or other materials</span></div>
<div class="line"><a name="l04687"></a><span class="lineno"> 4687</span>&#160;<span class="comment"> * provided with the distribution.</span></div>
<div class="line"><a name="l04688"></a><span class="lineno"> 4688</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04689"></a><span class="lineno"> 4689</span>&#160;<span class="comment"> * Neither the name of the author nor the names of contributors may be used to endorse</span></div>
<div class="line"><a name="l04690"></a><span class="lineno"> 4690</span>&#160;<span class="comment"> * or promote products derived from this software without specific prior written permission.</span></div>
<div class="line"><a name="l04691"></a><span class="lineno"> 4691</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04692"></a><span class="lineno"> 4692</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY</span></div>
<div class="line"><a name="l04693"></a><span class="lineno"> 4693</span>&#160;<span class="comment"> * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span></div>
<div class="line"><a name="l04694"></a><span class="lineno"> 4694</span>&#160;<span class="comment"> * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span></div>
<div class="line"><a name="l04695"></a><span class="lineno"> 4695</span>&#160;<span class="comment"> * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div>
<div class="line"><a name="l04696"></a><span class="lineno"> 4696</span>&#160;<span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span></div>
<div class="line"><a name="l04697"></a><span class="lineno"> 4697</span>&#160;<span class="comment"> * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED</span></div>
<div class="line"><a name="l04698"></a><span class="lineno"> 4698</span>&#160;<span class="comment"> * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span></div>
<div class="line"><a name="l04699"></a><span class="lineno"> 4699</span>&#160;<span class="comment"> * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED</span></div>
<div class="line"><a name="l04700"></a><span class="lineno"> 4700</span>&#160;<span class="comment"> * OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l04701"></a><span class="lineno"> 4701</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l04702"></a><span class="lineno"> 4702</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l04703"></a><span class="lineno"> 4703</span>&#160;</div>
<div class="line"><a name="l04704"></a><span class="lineno"> 4704</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04705"></a><span class="lineno"> 4705</span>&#160;</div>
<div class="line"><a name="l04706"></a><span class="lineno"> 4706</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04707"></a><span class="lineno"> 4707</span>&#160;</div>
<div class="line"><a name="l04708"></a><span class="lineno"> 4708</span>&#160;$.effects.blind = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04709"></a><span class="lineno"> 4709</span>&#160;</div>
<div class="line"><a name="l04710"></a><span class="lineno"> 4710</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04711"></a><span class="lineno"> 4711</span>&#160;</div>
<div class="line"><a name="l04712"></a><span class="lineno"> 4712</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l04713"></a><span class="lineno"> 4713</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>];</div>
<div class="line"><a name="l04714"></a><span class="lineno"> 4714</span>&#160;</div>
<div class="line"><a name="l04715"></a><span class="lineno"> 4715</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l04716"></a><span class="lineno"> 4716</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;hide&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l04717"></a><span class="lineno"> 4717</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;vertical&#39;</span>; <span class="comment">// Default direction</span></div>
<div class="line"><a name="l04718"></a><span class="lineno"> 4718</span>&#160;</div>
<div class="line"><a name="l04719"></a><span class="lineno"> 4719</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l04720"></a><span class="lineno"> 4720</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l04721"></a><span class="lineno"> 4721</span>&#160;        var wrapper = $.effects.createWrapper(el).css({overflow:<span class="stringliteral">&#39;hidden&#39;</span>}); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l04722"></a><span class="lineno"> 4722</span>&#160;        var ref = (direction == <span class="stringliteral">&#39;vertical&#39;</span>) ? <span class="stringliteral">&#39;height&#39;</span> : <span class="stringliteral">&#39;width&#39;</span>;</div>
<div class="line"><a name="l04723"></a><span class="lineno"> 4723</span>&#160;        var distance = (direction == <span class="stringliteral">&#39;vertical&#39;</span>) ? wrapper.height() : wrapper.width();</div>
<div class="line"><a name="l04724"></a><span class="lineno"> 4724</span>&#160;        <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;show&#39;</span>) wrapper.css(ref, 0); <span class="comment">// Shift</span></div>
<div class="line"><a name="l04725"></a><span class="lineno"> 4725</span>&#160;</div>
<div class="line"><a name="l04726"></a><span class="lineno"> 4726</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l04727"></a><span class="lineno"> 4727</span>&#160;        var animation = {};</div>
<div class="line"><a name="l04728"></a><span class="lineno"> 4728</span>&#160;        animation[ref] = mode == <span class="stringliteral">&#39;show&#39;</span> ? distance : 0;</div>
<div class="line"><a name="l04729"></a><span class="lineno"> 4729</span>&#160;</div>
<div class="line"><a name="l04730"></a><span class="lineno"> 4730</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l04731"></a><span class="lineno"> 4731</span>&#160;        wrapper.animate(animation, o.duration, o.options.easing, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l04732"></a><span class="lineno"> 4732</span>&#160;            <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;hide&#39;</span>) el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l04733"></a><span class="lineno"> 4733</span>&#160;            $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l04734"></a><span class="lineno"> 4734</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(el[0], arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l04735"></a><span class="lineno"> 4735</span>&#160;            el.dequeue();</div>
<div class="line"><a name="l04736"></a><span class="lineno"> 4736</span>&#160;        });</div>
<div class="line"><a name="l04737"></a><span class="lineno"> 4737</span>&#160;</div>
<div class="line"><a name="l04738"></a><span class="lineno"> 4738</span>&#160;    });</div>
<div class="line"><a name="l04739"></a><span class="lineno"> 4739</span>&#160;</div>
<div class="line"><a name="l04740"></a><span class="lineno"> 4740</span>&#160;};</div>
<div class="line"><a name="l04741"></a><span class="lineno"> 4741</span>&#160;</div>
<div class="line"><a name="l04742"></a><span class="lineno"> 4742</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04743"></a><span class="lineno"> 4743</span>&#160;</div>
<div class="line"><a name="l04744"></a><span class="lineno"> 4744</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04745"></a><span class="lineno"> 4745</span>&#160;</div>
<div class="line"><a name="l04746"></a><span class="lineno"> 4746</span>&#160;$.effects.bounce = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04747"></a><span class="lineno"> 4747</span>&#160;</div>
<div class="line"><a name="l04748"></a><span class="lineno"> 4748</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04749"></a><span class="lineno"> 4749</span>&#160;</div>
<div class="line"><a name="l04750"></a><span class="lineno"> 4750</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l04751"></a><span class="lineno"> 4751</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>];</div>
<div class="line"><a name="l04752"></a><span class="lineno"> 4752</span>&#160;</div>
<div class="line"><a name="l04753"></a><span class="lineno"> 4753</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l04754"></a><span class="lineno"> 4754</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;effect&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l04755"></a><span class="lineno"> 4755</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;up&#39;</span>; <span class="comment">// Default direction</span></div>
<div class="line"><a name="l04756"></a><span class="lineno"> 4756</span>&#160;        var distance = o.options.distance || 20; <span class="comment">// Default distance</span></div>
<div class="line"><a name="l04757"></a><span class="lineno"> 4757</span>&#160;        var times = o.options.times || 5; <span class="comment">// Default # of times</span></div>
<div class="line"><a name="l04758"></a><span class="lineno"> 4758</span>&#160;        var speed = o.duration || 250; <span class="comment">// Default speed per bounce</span></div>
<div class="line"><a name="l04759"></a><span class="lineno"> 4759</span>&#160;        <span class="keywordflow">if</span> (/show|hide/.test(mode)) props.push(<span class="stringliteral">&#39;opacity&#39;</span>); <span class="comment">// Avoid touching opacity to prevent clearType and PNG issues in IE</span></div>
<div class="line"><a name="l04760"></a><span class="lineno"> 4760</span>&#160;</div>
<div class="line"><a name="l04761"></a><span class="lineno"> 4761</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l04762"></a><span class="lineno"> 4762</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l04763"></a><span class="lineno"> 4763</span>&#160;        $.effects.createWrapper(el); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l04764"></a><span class="lineno"> 4764</span>&#160;        var ref = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;down&#39;</span>) ? <span class="stringliteral">&#39;top&#39;</span> : <span class="stringliteral">&#39;left&#39;</span>;</div>
<div class="line"><a name="l04765"></a><span class="lineno"> 4765</span>&#160;        var motion = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;left&#39;</span>) ? <span class="stringliteral">&#39;pos&#39;</span> : <span class="stringliteral">&#39;neg&#39;</span>;</div>
<div class="line"><a name="l04766"></a><span class="lineno"> 4766</span>&#160;        var distance = o.options.distance || (ref == <span class="stringliteral">&#39;top&#39;</span> ? el.outerHeight({margin:<span class="keyword">true</span>}) / 3 : el.outerWidth({margin:<span class="keyword">true</span>}) / 3);</div>
<div class="line"><a name="l04767"></a><span class="lineno"> 4767</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;show&#39;</span>) el.css(<span class="stringliteral">&#39;opacity&#39;</span>, 0).css(ref, motion == <span class="stringliteral">&#39;pos&#39;</span> ? -distance : distance); <span class="comment">// Shift</span></div>
<div class="line"><a name="l04768"></a><span class="lineno"> 4768</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;hide&#39;</span>) distance = distance / (times * 2);</div>
<div class="line"><a name="l04769"></a><span class="lineno"> 4769</span>&#160;        <span class="keywordflow">if</span> (mode != <span class="stringliteral">&#39;hide&#39;</span>) times--;</div>
<div class="line"><a name="l04770"></a><span class="lineno"> 4770</span>&#160;</div>
<div class="line"><a name="l04771"></a><span class="lineno"> 4771</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l04772"></a><span class="lineno"> 4772</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;show&#39;</span>) { <span class="comment">// Show Bounce</span></div>
<div class="line"><a name="l04773"></a><span class="lineno"> 4773</span>&#160;            var animation = {opacity: 1};</div>
<div class="line"><a name="l04774"></a><span class="lineno"> 4774</span>&#160;            animation[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;+=&#39;</span> : <span class="stringliteral">&#39;-=&#39;</span>) + distance;</div>
<div class="line"><a name="l04775"></a><span class="lineno"> 4775</span>&#160;            el.animate(animation, speed / 2, o.options.easing);</div>
<div class="line"><a name="l04776"></a><span class="lineno"> 4776</span>&#160;            distance = distance / 2;</div>
<div class="line"><a name="l04777"></a><span class="lineno"> 4777</span>&#160;            times--;</div>
<div class="line"><a name="l04778"></a><span class="lineno"> 4778</span>&#160;        };</div>
<div class="line"><a name="l04779"></a><span class="lineno"> 4779</span>&#160;        <span class="keywordflow">for</span> (var i = 0; i &lt; times; i++) { <span class="comment">// Bounces</span></div>
<div class="line"><a name="l04780"></a><span class="lineno"> 4780</span>&#160;            var animation1 = {}, animation2 = {};</div>
<div class="line"><a name="l04781"></a><span class="lineno"> 4781</span>&#160;            animation1[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>) + distance;</div>
<div class="line"><a name="l04782"></a><span class="lineno"> 4782</span>&#160;            animation2[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;+=&#39;</span> : <span class="stringliteral">&#39;-=&#39;</span>) + distance;</div>
<div class="line"><a name="l04783"></a><span class="lineno"> 4783</span>&#160;            el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);</div>
<div class="line"><a name="l04784"></a><span class="lineno"> 4784</span>&#160;            distance = (mode == <span class="stringliteral">&#39;hide&#39;</span>) ? distance * 2 : distance / 2;</div>
<div class="line"><a name="l04785"></a><span class="lineno"> 4785</span>&#160;        };</div>
<div class="line"><a name="l04786"></a><span class="lineno"> 4786</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;hide&#39;</span>) { <span class="comment">// Last Bounce</span></div>
<div class="line"><a name="l04787"></a><span class="lineno"> 4787</span>&#160;            var animation = {opacity: 0};</div>
<div class="line"><a name="l04788"></a><span class="lineno"> 4788</span>&#160;            animation[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>)  + distance;</div>
<div class="line"><a name="l04789"></a><span class="lineno"> 4789</span>&#160;            el.animate(animation, speed / 2, o.options.easing, <span class="keyword">function</span>(){</div>
<div class="line"><a name="l04790"></a><span class="lineno"> 4790</span>&#160;                el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l04791"></a><span class="lineno"> 4791</span>&#160;                $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l04792"></a><span class="lineno"> 4792</span>&#160;                <span class="keywordflow">if</span>(o.callback) o.callback.apply(<span class="keyword">this</span>, arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l04793"></a><span class="lineno"> 4793</span>&#160;            });</div>
<div class="line"><a name="l04794"></a><span class="lineno"> 4794</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04795"></a><span class="lineno"> 4795</span>&#160;            var animation1 = {}, animation2 = {};</div>
<div class="line"><a name="l04796"></a><span class="lineno"> 4796</span>&#160;            animation1[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>) + distance;</div>
<div class="line"><a name="l04797"></a><span class="lineno"> 4797</span>&#160;            animation2[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;+=&#39;</span> : <span class="stringliteral">&#39;-=&#39;</span>) + distance;</div>
<div class="line"><a name="l04798"></a><span class="lineno"> 4798</span>&#160;            el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, <span class="keyword">function</span>(){</div>
<div class="line"><a name="l04799"></a><span class="lineno"> 4799</span>&#160;                $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l04800"></a><span class="lineno"> 4800</span>&#160;                <span class="keywordflow">if</span>(o.callback) o.callback.apply(<span class="keyword">this</span>, arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l04801"></a><span class="lineno"> 4801</span>&#160;            });</div>
<div class="line"><a name="l04802"></a><span class="lineno"> 4802</span>&#160;        };</div>
<div class="line"><a name="l04803"></a><span class="lineno"> 4803</span>&#160;        el.queue(<span class="stringliteral">&#39;fx&#39;</span>, <span class="keyword">function</span>() { el.dequeue(); });</div>
<div class="line"><a name="l04804"></a><span class="lineno"> 4804</span>&#160;        el.dequeue();</div>
<div class="line"><a name="l04805"></a><span class="lineno"> 4805</span>&#160;    });</div>
<div class="line"><a name="l04806"></a><span class="lineno"> 4806</span>&#160;</div>
<div class="line"><a name="l04807"></a><span class="lineno"> 4807</span>&#160;};</div>
<div class="line"><a name="l04808"></a><span class="lineno"> 4808</span>&#160;</div>
<div class="line"><a name="l04809"></a><span class="lineno"> 4809</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04810"></a><span class="lineno"> 4810</span>&#160;</div>
<div class="line"><a name="l04811"></a><span class="lineno"> 4811</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04812"></a><span class="lineno"> 4812</span>&#160;</div>
<div class="line"><a name="l04813"></a><span class="lineno"> 4813</span>&#160;$.effects.clip = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04814"></a><span class="lineno"> 4814</span>&#160;</div>
<div class="line"><a name="l04815"></a><span class="lineno"> 4815</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04816"></a><span class="lineno"> 4816</span>&#160;</div>
<div class="line"><a name="l04817"></a><span class="lineno"> 4817</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l04818"></a><span class="lineno"> 4818</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>,<span class="stringliteral">&#39;height&#39;</span>,<span class="stringliteral">&#39;width&#39;</span>];</div>
<div class="line"><a name="l04819"></a><span class="lineno"> 4819</span>&#160;</div>
<div class="line"><a name="l04820"></a><span class="lineno"> 4820</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l04821"></a><span class="lineno"> 4821</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;hide&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l04822"></a><span class="lineno"> 4822</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;vertical&#39;</span>; <span class="comment">// Default direction</span></div>
<div class="line"><a name="l04823"></a><span class="lineno"> 4823</span>&#160;</div>
<div class="line"><a name="l04824"></a><span class="lineno"> 4824</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l04825"></a><span class="lineno"> 4825</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l04826"></a><span class="lineno"> 4826</span>&#160;        var wrapper = $.effects.createWrapper(el).css({overflow:<span class="stringliteral">&#39;hidden&#39;</span>}); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l04827"></a><span class="lineno"> 4827</span>&#160;        var animate = el[0].tagName == <span class="stringliteral">&#39;IMG&#39;</span> ? wrapper : el;</div>
<div class="line"><a name="l04828"></a><span class="lineno"> 4828</span>&#160;        var ref = {</div>
<div class="line"><a name="l04829"></a><span class="lineno"> 4829</span>&#160;            size: (direction == <span class="stringliteral">&#39;vertical&#39;</span>) ? <span class="stringliteral">&#39;height&#39;</span> : <span class="stringliteral">&#39;width&#39;</span>,</div>
<div class="line"><a name="l04830"></a><span class="lineno"> 4830</span>&#160;            position: (direction == <span class="stringliteral">&#39;vertical&#39;</span>) ? <span class="stringliteral">&#39;top&#39;</span> : <span class="stringliteral">&#39;left&#39;</span></div>
<div class="line"><a name="l04831"></a><span class="lineno"> 4831</span>&#160;        };</div>
<div class="line"><a name="l04832"></a><span class="lineno"> 4832</span>&#160;        var distance = (direction == <span class="stringliteral">&#39;vertical&#39;</span>) ? animate.height() : animate.width();</div>
<div class="line"><a name="l04833"></a><span class="lineno"> 4833</span>&#160;        <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;show&#39;</span>) { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } <span class="comment">// Shift</span></div>
<div class="line"><a name="l04834"></a><span class="lineno"> 4834</span>&#160;</div>
<div class="line"><a name="l04835"></a><span class="lineno"> 4835</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l04836"></a><span class="lineno"> 4836</span>&#160;        var animation = {};</div>
<div class="line"><a name="l04837"></a><span class="lineno"> 4837</span>&#160;        animation[ref.size] = mode == <span class="stringliteral">&#39;show&#39;</span> ? distance : 0;</div>
<div class="line"><a name="l04838"></a><span class="lineno"> 4838</span>&#160;        animation[ref.position] = mode == <span class="stringliteral">&#39;show&#39;</span> ? 0 : distance / 2;</div>
<div class="line"><a name="l04839"></a><span class="lineno"> 4839</span>&#160;</div>
<div class="line"><a name="l04840"></a><span class="lineno"> 4840</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l04841"></a><span class="lineno"> 4841</span>&#160;        animate.animate(animation, { queue: <span class="keyword">false</span>, duration: o.duration, easing: o.options.easing, complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l04842"></a><span class="lineno"> 4842</span>&#160;            <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;hide&#39;</span>) el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l04843"></a><span class="lineno"> 4843</span>&#160;            $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l04844"></a><span class="lineno"> 4844</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(el[0], arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l04845"></a><span class="lineno"> 4845</span>&#160;            el.dequeue();</div>
<div class="line"><a name="l04846"></a><span class="lineno"> 4846</span>&#160;        }});</div>
<div class="line"><a name="l04847"></a><span class="lineno"> 4847</span>&#160;</div>
<div class="line"><a name="l04848"></a><span class="lineno"> 4848</span>&#160;    });</div>
<div class="line"><a name="l04849"></a><span class="lineno"> 4849</span>&#160;</div>
<div class="line"><a name="l04850"></a><span class="lineno"> 4850</span>&#160;};</div>
<div class="line"><a name="l04851"></a><span class="lineno"> 4851</span>&#160;</div>
<div class="line"><a name="l04852"></a><span class="lineno"> 4852</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04853"></a><span class="lineno"> 4853</span>&#160;</div>
<div class="line"><a name="l04854"></a><span class="lineno"> 4854</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04855"></a><span class="lineno"> 4855</span>&#160;</div>
<div class="line"><a name="l04856"></a><span class="lineno"> 4856</span>&#160;$.effects.drop = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04857"></a><span class="lineno"> 4857</span>&#160;</div>
<div class="line"><a name="l04858"></a><span class="lineno"> 4858</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04859"></a><span class="lineno"> 4859</span>&#160;</div>
<div class="line"><a name="l04860"></a><span class="lineno"> 4860</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l04861"></a><span class="lineno"> 4861</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>,<span class="stringliteral">&#39;opacity&#39;</span>];</div>
<div class="line"><a name="l04862"></a><span class="lineno"> 4862</span>&#160;</div>
<div class="line"><a name="l04863"></a><span class="lineno"> 4863</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l04864"></a><span class="lineno"> 4864</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;hide&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l04865"></a><span class="lineno"> 4865</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;left&#39;</span>; <span class="comment">// Default Direction</span></div>
<div class="line"><a name="l04866"></a><span class="lineno"> 4866</span>&#160;</div>
<div class="line"><a name="l04867"></a><span class="lineno"> 4867</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l04868"></a><span class="lineno"> 4868</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l04869"></a><span class="lineno"> 4869</span>&#160;        $.effects.createWrapper(el); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l04870"></a><span class="lineno"> 4870</span>&#160;        var ref = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;down&#39;</span>) ? <span class="stringliteral">&#39;top&#39;</span> : <span class="stringliteral">&#39;left&#39;</span>;</div>
<div class="line"><a name="l04871"></a><span class="lineno"> 4871</span>&#160;        var motion = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;left&#39;</span>) ? <span class="stringliteral">&#39;pos&#39;</span> : <span class="stringliteral">&#39;neg&#39;</span>;</div>
<div class="line"><a name="l04872"></a><span class="lineno"> 4872</span>&#160;        var distance = o.options.distance || (ref == <span class="stringliteral">&#39;top&#39;</span> ? el.outerHeight({margin:<span class="keyword">true</span>}) / 2 : el.outerWidth({margin:<span class="keyword">true</span>}) / 2);</div>
<div class="line"><a name="l04873"></a><span class="lineno"> 4873</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;show&#39;</span>) el.css(<span class="stringliteral">&#39;opacity&#39;</span>, 0).css(ref, motion == <span class="stringliteral">&#39;pos&#39;</span> ? -distance : distance); <span class="comment">// Shift</span></div>
<div class="line"><a name="l04874"></a><span class="lineno"> 4874</span>&#160;</div>
<div class="line"><a name="l04875"></a><span class="lineno"> 4875</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l04876"></a><span class="lineno"> 4876</span>&#160;        var animation = {opacity: mode == <span class="stringliteral">&#39;show&#39;</span> ? 1 : 0};</div>
<div class="line"><a name="l04877"></a><span class="lineno"> 4877</span>&#160;        animation[ref] = (mode == <span class="stringliteral">&#39;show&#39;</span> ? (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;+=&#39;</span> : <span class="stringliteral">&#39;-=&#39;</span>) : (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>)) + distance;</div>
<div class="line"><a name="l04878"></a><span class="lineno"> 4878</span>&#160;</div>
<div class="line"><a name="l04879"></a><span class="lineno"> 4879</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l04880"></a><span class="lineno"> 4880</span>&#160;        el.animate(animation, { queue: <span class="keyword">false</span>, duration: o.duration, easing: o.options.easing, complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l04881"></a><span class="lineno"> 4881</span>&#160;            <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;hide&#39;</span>) el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l04882"></a><span class="lineno"> 4882</span>&#160;            $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l04883"></a><span class="lineno"> 4883</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(<span class="keyword">this</span>, arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l04884"></a><span class="lineno"> 4884</span>&#160;            el.dequeue();</div>
<div class="line"><a name="l04885"></a><span class="lineno"> 4885</span>&#160;        }});</div>
<div class="line"><a name="l04886"></a><span class="lineno"> 4886</span>&#160;</div>
<div class="line"><a name="l04887"></a><span class="lineno"> 4887</span>&#160;    });</div>
<div class="line"><a name="l04888"></a><span class="lineno"> 4888</span>&#160;</div>
<div class="line"><a name="l04889"></a><span class="lineno"> 4889</span>&#160;};</div>
<div class="line"><a name="l04890"></a><span class="lineno"> 4890</span>&#160;</div>
<div class="line"><a name="l04891"></a><span class="lineno"> 4891</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04892"></a><span class="lineno"> 4892</span>&#160;</div>
<div class="line"><a name="l04893"></a><span class="lineno"> 4893</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04894"></a><span class="lineno"> 4894</span>&#160;</div>
<div class="line"><a name="l04895"></a><span class="lineno"> 4895</span>&#160;$.effects.explode = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04896"></a><span class="lineno"> 4896</span>&#160;</div>
<div class="line"><a name="l04897"></a><span class="lineno"> 4897</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04898"></a><span class="lineno"> 4898</span>&#160;</div>
<div class="line"><a name="l04899"></a><span class="lineno"> 4899</span>&#160;    var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;</div>
<div class="line"><a name="l04900"></a><span class="lineno"> 4900</span>&#160;    var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;</div>
<div class="line"><a name="l04901"></a><span class="lineno"> 4901</span>&#160;</div>
<div class="line"><a name="l04902"></a><span class="lineno"> 4902</span>&#160;    o.options.mode = o.options.mode == <span class="stringliteral">&#39;toggle&#39;</span> ? ($(<span class="keyword">this</span>).is(<span class="stringliteral">&#39;:visible&#39;</span>) ? <span class="stringliteral">&#39;hide&#39;</span> : <span class="stringliteral">&#39;show&#39;</span>) : o.options.mode;</div>
<div class="line"><a name="l04903"></a><span class="lineno"> 4903</span>&#160;    var el = $(<span class="keyword">this</span>).show().css(<span class="stringliteral">&#39;visibility&#39;</span>, <span class="stringliteral">&#39;hidden&#39;</span>);</div>
<div class="line"><a name="l04904"></a><span class="lineno"> 4904</span>&#160;    var offset = el.offset();</div>
<div class="line"><a name="l04905"></a><span class="lineno"> 4905</span>&#160;</div>
<div class="line"><a name="l04906"></a><span class="lineno"> 4906</span>&#160;    <span class="comment">//Substract the margins - not fixing the problem yet.</span></div>
<div class="line"><a name="l04907"></a><span class="lineno"> 4907</span>&#160;    offset.top -= parseInt(el.css(<span class="stringliteral">&quot;marginTop&quot;</span>),10) || 0;</div>
<div class="line"><a name="l04908"></a><span class="lineno"> 4908</span>&#160;    offset.left -= parseInt(el.css(<span class="stringliteral">&quot;marginLeft&quot;</span>),10) || 0;</div>
<div class="line"><a name="l04909"></a><span class="lineno"> 4909</span>&#160;</div>
<div class="line"><a name="l04910"></a><span class="lineno"> 4910</span>&#160;    var width = el.outerWidth(<span class="keyword">true</span>);</div>
<div class="line"><a name="l04911"></a><span class="lineno"> 4911</span>&#160;    var height = el.outerHeight(<span class="keyword">true</span>);</div>
<div class="line"><a name="l04912"></a><span class="lineno"> 4912</span>&#160;</div>
<div class="line"><a name="l04913"></a><span class="lineno"> 4913</span>&#160;    <span class="keywordflow">for</span>(var i=0;i&lt;rows;i++) { <span class="comment">// =</span></div>
<div class="line"><a name="l04914"></a><span class="lineno"> 4914</span>&#160;        <span class="keywordflow">for</span>(var j=0;j&lt;cells;j++) { <span class="comment">// ||</span></div>
<div class="line"><a name="l04915"></a><span class="lineno"> 4915</span>&#160;            el</div>
<div class="line"><a name="l04916"></a><span class="lineno"> 4916</span>&#160;                .clone()</div>
<div class="line"><a name="l04917"></a><span class="lineno"> 4917</span>&#160;                .appendTo(<span class="stringliteral">&#39;body&#39;</span>)</div>
<div class="line"><a name="l04918"></a><span class="lineno"> 4918</span>&#160;                .wrap(<span class="stringliteral">&#39;&lt;div&gt;&lt;/div&gt;&#39;</span>)</div>
<div class="line"><a name="l04919"></a><span class="lineno"> 4919</span>&#160;                .css({</div>
<div class="line"><a name="l04920"></a><span class="lineno"> 4920</span>&#160;                    position: <span class="stringliteral">&#39;absolute&#39;</span>,</div>
<div class="line"><a name="l04921"></a><span class="lineno"> 4921</span>&#160;                    visibility: <span class="stringliteral">&#39;visible&#39;</span>,</div>
<div class="line"><a name="l04922"></a><span class="lineno"> 4922</span>&#160;                    left: -j*(width/cells),</div>
<div class="line"><a name="l04923"></a><span class="lineno"> 4923</span>&#160;                    top: -i*(height/rows)</div>
<div class="line"><a name="l04924"></a><span class="lineno"> 4924</span>&#160;                })</div>
<div class="line"><a name="l04925"></a><span class="lineno"> 4925</span>&#160;                .parent()</div>
<div class="line"><a name="l04926"></a><span class="lineno"> 4926</span>&#160;                .addClass(<span class="stringliteral">&#39;ui-effects-explode&#39;</span>)</div>
<div class="line"><a name="l04927"></a><span class="lineno"> 4927</span>&#160;                .css({</div>
<div class="line"><a name="l04928"></a><span class="lineno"> 4928</span>&#160;                    position: <span class="stringliteral">&#39;absolute&#39;</span>,</div>
<div class="line"><a name="l04929"></a><span class="lineno"> 4929</span>&#160;                    overflow: <span class="stringliteral">&#39;hidden&#39;</span>,</div>
<div class="line"><a name="l04930"></a><span class="lineno"> 4930</span>&#160;                    width: width/cells,</div>
<div class="line"><a name="l04931"></a><span class="lineno"> 4931</span>&#160;                    height: height/rows,</div>
<div class="line"><a name="l04932"></a><span class="lineno"> 4932</span>&#160;                    left: offset.left + j*(width/cells) + (o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? (j-Math.floor(cells/2))*(width/cells) : 0),</div>
<div class="line"><a name="l04933"></a><span class="lineno"> 4933</span>&#160;                    top: offset.top + i*(height/rows) + (o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? (i-Math.floor(rows/2))*(height/rows) : 0),</div>
<div class="line"><a name="l04934"></a><span class="lineno"> 4934</span>&#160;                    opacity: o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? 0 : 1</div>
<div class="line"><a name="l04935"></a><span class="lineno"> 4935</span>&#160;                }).animate({</div>
<div class="line"><a name="l04936"></a><span class="lineno"> 4936</span>&#160;                    left: offset.left + j*(width/cells) + (o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? 0 : (j-Math.floor(cells/2))*(width/cells)),</div>
<div class="line"><a name="l04937"></a><span class="lineno"> 4937</span>&#160;                    top: offset.top + i*(height/rows) + (o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? 0 : (i-Math.floor(rows/2))*(height/rows)),</div>
<div class="line"><a name="l04938"></a><span class="lineno"> 4938</span>&#160;                    opacity: o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? 1 : 0</div>
<div class="line"><a name="l04939"></a><span class="lineno"> 4939</span>&#160;                }, o.duration || 500);</div>
<div class="line"><a name="l04940"></a><span class="lineno"> 4940</span>&#160;        }</div>
<div class="line"><a name="l04941"></a><span class="lineno"> 4941</span>&#160;    }</div>
<div class="line"><a name="l04942"></a><span class="lineno"> 4942</span>&#160;</div>
<div class="line"><a name="l04943"></a><span class="lineno"> 4943</span>&#160;    <span class="comment">// Set a timeout, to call the callback approx. when the other animations have finished</span></div>
<div class="line"><a name="l04944"></a><span class="lineno"> 4944</span>&#160;    setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04945"></a><span class="lineno"> 4945</span>&#160;</div>
<div class="line"><a name="l04946"></a><span class="lineno"> 4946</span>&#160;        o.options.mode == <span class="stringliteral">&#39;show&#39;</span> ? el.css({ visibility: <span class="stringliteral">&#39;visible&#39;</span> }) : el.css({ visibility: <span class="stringliteral">&#39;visible&#39;</span> }).hide();</div>
<div class="line"><a name="l04947"></a><span class="lineno"> 4947</span>&#160;                <span class="keywordflow">if</span>(o.callback) o.callback.apply(el[0]); <span class="comment">// Callback</span></div>
<div class="line"><a name="l04948"></a><span class="lineno"> 4948</span>&#160;                el.dequeue();</div>
<div class="line"><a name="l04949"></a><span class="lineno"> 4949</span>&#160;</div>
<div class="line"><a name="l04950"></a><span class="lineno"> 4950</span>&#160;                $(<span class="stringliteral">&#39;div.ui-effects-explode&#39;</span>).<span class="keyword">remove</span>();</div>
<div class="line"><a name="l04951"></a><span class="lineno"> 4951</span>&#160;</div>
<div class="line"><a name="l04952"></a><span class="lineno"> 4952</span>&#160;    }, o.duration || 500);</div>
<div class="line"><a name="l04953"></a><span class="lineno"> 4953</span>&#160;</div>
<div class="line"><a name="l04954"></a><span class="lineno"> 4954</span>&#160;</div>
<div class="line"><a name="l04955"></a><span class="lineno"> 4955</span>&#160;    });</div>
<div class="line"><a name="l04956"></a><span class="lineno"> 4956</span>&#160;</div>
<div class="line"><a name="l04957"></a><span class="lineno"> 4957</span>&#160;};</div>
<div class="line"><a name="l04958"></a><span class="lineno"> 4958</span>&#160;</div>
<div class="line"><a name="l04959"></a><span class="lineno"> 4959</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04960"></a><span class="lineno"> 4960</span>&#160;</div>
<div class="line"><a name="l04961"></a><span class="lineno"> 4961</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04962"></a><span class="lineno"> 4962</span>&#160;</div>
<div class="line"><a name="l04963"></a><span class="lineno"> 4963</span>&#160;$.effects.fade = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04964"></a><span class="lineno"> 4964</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04965"></a><span class="lineno"> 4965</span>&#160;        var elem = $(<span class="keyword">this</span>),</div>
<div class="line"><a name="l04966"></a><span class="lineno"> 4966</span>&#160;            mode = $.effects.setMode(elem, o.options.mode || <span class="stringliteral">&#39;hide&#39;</span>);</div>
<div class="line"><a name="l04967"></a><span class="lineno"> 4967</span>&#160;</div>
<div class="line"><a name="l04968"></a><span class="lineno"> 4968</span>&#160;        elem.animate({ opacity: mode }, {</div>
<div class="line"><a name="l04969"></a><span class="lineno"> 4969</span>&#160;            queue: <span class="keyword">false</span>,</div>
<div class="line"><a name="l04970"></a><span class="lineno"> 4970</span>&#160;            duration: o.duration,</div>
<div class="line"><a name="l04971"></a><span class="lineno"> 4971</span>&#160;            easing: o.options.easing,</div>
<div class="line"><a name="l04972"></a><span class="lineno"> 4972</span>&#160;            complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l04973"></a><span class="lineno"> 4973</span>&#160;                (o.callback &amp;&amp; o.callback.apply(<span class="keyword">this</span>, arguments));</div>
<div class="line"><a name="l04974"></a><span class="lineno"> 4974</span>&#160;                elem.dequeue();</div>
<div class="line"><a name="l04975"></a><span class="lineno"> 4975</span>&#160;            }</div>
<div class="line"><a name="l04976"></a><span class="lineno"> 4976</span>&#160;        });</div>
<div class="line"><a name="l04977"></a><span class="lineno"> 4977</span>&#160;    });</div>
<div class="line"><a name="l04978"></a><span class="lineno"> 4978</span>&#160;};</div>
<div class="line"><a name="l04979"></a><span class="lineno"> 4979</span>&#160;</div>
<div class="line"><a name="l04980"></a><span class="lineno"> 4980</span>&#160;})(jQuery);</div>
<div class="line"><a name="l04981"></a><span class="lineno"> 4981</span>&#160;</div>
<div class="line"><a name="l04982"></a><span class="lineno"> 4982</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l04983"></a><span class="lineno"> 4983</span>&#160;</div>
<div class="line"><a name="l04984"></a><span class="lineno"> 4984</span>&#160;$.effects.fold = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l04985"></a><span class="lineno"> 4985</span>&#160;</div>
<div class="line"><a name="l04986"></a><span class="lineno"> 4986</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l04987"></a><span class="lineno"> 4987</span>&#160;</div>
<div class="line"><a name="l04988"></a><span class="lineno"> 4988</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l04989"></a><span class="lineno"> 4989</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>];</div>
<div class="line"><a name="l04990"></a><span class="lineno"> 4990</span>&#160;</div>
<div class="line"><a name="l04991"></a><span class="lineno"> 4991</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l04992"></a><span class="lineno"> 4992</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;hide&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l04993"></a><span class="lineno"> 4993</span>&#160;        var size = o.options.size || 15; <span class="comment">// Default fold size</span></div>
<div class="line"><a name="l04994"></a><span class="lineno"> 4994</span>&#160;        var horizFirst = !(!o.options.horizFirst); <span class="comment">// Ensure a boolean value</span></div>
<div class="line"><a name="l04995"></a><span class="lineno"> 4995</span>&#160;        var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;</div>
<div class="line"><a name="l04996"></a><span class="lineno"> 4996</span>&#160;</div>
<div class="line"><a name="l04997"></a><span class="lineno"> 4997</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l04998"></a><span class="lineno"> 4998</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l04999"></a><span class="lineno"> 4999</span>&#160;        var wrapper = $.effects.createWrapper(el).css({overflow:<span class="stringliteral">&#39;hidden&#39;</span>}); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l05000"></a><span class="lineno"> 5000</span>&#160;        var widthFirst = ((mode == <span class="stringliteral">&#39;show&#39;</span>) != horizFirst);</div>
<div class="line"><a name="l05001"></a><span class="lineno"> 5001</span>&#160;        var ref = widthFirst ? [<span class="stringliteral">&#39;width&#39;</span>, <span class="stringliteral">&#39;height&#39;</span>] : [<span class="stringliteral">&#39;height&#39;</span>, <span class="stringliteral">&#39;width&#39;</span>];</div>
<div class="line"><a name="l05002"></a><span class="lineno"> 5002</span>&#160;        var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];</div>
<div class="line"><a name="l05003"></a><span class="lineno"> 5003</span>&#160;        var percent = /([0-9]+)%/.exec(size);</div>
<div class="line"><a name="l05004"></a><span class="lineno"> 5004</span>&#160;        <span class="keywordflow">if</span>(percent) size = parseInt(percent[1],10) / 100 * distance[mode == <span class="stringliteral">&#39;hide&#39;</span> ? 0 : 1];</div>
<div class="line"><a name="l05005"></a><span class="lineno"> 5005</span>&#160;        <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;show&#39;</span>) wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); <span class="comment">// Shift</span></div>
<div class="line"><a name="l05006"></a><span class="lineno"> 5006</span>&#160;</div>
<div class="line"><a name="l05007"></a><span class="lineno"> 5007</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l05008"></a><span class="lineno"> 5008</span>&#160;        var animation1 = {}, animation2 = {};</div>
<div class="line"><a name="l05009"></a><span class="lineno"> 5009</span>&#160;        animation1[ref[0]] = mode == <span class="stringliteral">&#39;show&#39;</span> ? distance[0] : size;</div>
<div class="line"><a name="l05010"></a><span class="lineno"> 5010</span>&#160;        animation2[ref[1]] = mode == <span class="stringliteral">&#39;show&#39;</span> ? distance[1] : 0;</div>
<div class="line"><a name="l05011"></a><span class="lineno"> 5011</span>&#160;</div>
<div class="line"><a name="l05012"></a><span class="lineno"> 5012</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l05013"></a><span class="lineno"> 5013</span>&#160;        wrapper.animate(animation1, duration, o.options.easing)</div>
<div class="line"><a name="l05014"></a><span class="lineno"> 5014</span>&#160;        .animate(animation2, duration, o.options.easing, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05015"></a><span class="lineno"> 5015</span>&#160;            <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;hide&#39;</span>) el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l05016"></a><span class="lineno"> 5016</span>&#160;            $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l05017"></a><span class="lineno"> 5017</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(el[0], arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l05018"></a><span class="lineno"> 5018</span>&#160;            el.dequeue();</div>
<div class="line"><a name="l05019"></a><span class="lineno"> 5019</span>&#160;        });</div>
<div class="line"><a name="l05020"></a><span class="lineno"> 5020</span>&#160;</div>
<div class="line"><a name="l05021"></a><span class="lineno"> 5021</span>&#160;    });</div>
<div class="line"><a name="l05022"></a><span class="lineno"> 5022</span>&#160;</div>
<div class="line"><a name="l05023"></a><span class="lineno"> 5023</span>&#160;};</div>
<div class="line"><a name="l05024"></a><span class="lineno"> 5024</span>&#160;</div>
<div class="line"><a name="l05025"></a><span class="lineno"> 5025</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05026"></a><span class="lineno"> 5026</span>&#160;</div>
<div class="line"><a name="l05027"></a><span class="lineno"> 5027</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05028"></a><span class="lineno"> 5028</span>&#160;</div>
<div class="line"><a name="l05029"></a><span class="lineno"> 5029</span>&#160;$.effects.highlight = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05030"></a><span class="lineno"> 5030</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05031"></a><span class="lineno"> 5031</span>&#160;        var elem = $(<span class="keyword">this</span>),</div>
<div class="line"><a name="l05032"></a><span class="lineno"> 5032</span>&#160;            props = [<span class="stringliteral">&#39;backgroundImage&#39;</span>, <span class="stringliteral">&#39;backgroundColor&#39;</span>, <span class="stringliteral">&#39;opacity&#39;</span>],</div>
<div class="line"><a name="l05033"></a><span class="lineno"> 5033</span>&#160;            mode = $.effects.setMode(elem, o.options.mode || <span class="stringliteral">&#39;show&#39;</span>),</div>
<div class="line"><a name="l05034"></a><span class="lineno"> 5034</span>&#160;            animation = {</div>
<div class="line"><a name="l05035"></a><span class="lineno"> 5035</span>&#160;                backgroundColor: elem.css(<span class="stringliteral">&#39;backgroundColor&#39;</span>)</div>
<div class="line"><a name="l05036"></a><span class="lineno"> 5036</span>&#160;            };</div>
<div class="line"><a name="l05037"></a><span class="lineno"> 5037</span>&#160;</div>
<div class="line"><a name="l05038"></a><span class="lineno"> 5038</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;hide&#39;</span>) {</div>
<div class="line"><a name="l05039"></a><span class="lineno"> 5039</span>&#160;            animation.opacity = 0;</div>
<div class="line"><a name="l05040"></a><span class="lineno"> 5040</span>&#160;        }</div>
<div class="line"><a name="l05041"></a><span class="lineno"> 5041</span>&#160;</div>
<div class="line"><a name="l05042"></a><span class="lineno"> 5042</span>&#160;        $.effects.save(elem, props);</div>
<div class="line"><a name="l05043"></a><span class="lineno"> 5043</span>&#160;        elem</div>
<div class="line"><a name="l05044"></a><span class="lineno"> 5044</span>&#160;            .show()</div>
<div class="line"><a name="l05045"></a><span class="lineno"> 5045</span>&#160;            .css({</div>
<div class="line"><a name="l05046"></a><span class="lineno"> 5046</span>&#160;                backgroundImage: <span class="stringliteral">&#39;none&#39;</span>,</div>
<div class="line"><a name="l05047"></a><span class="lineno"> 5047</span>&#160;                backgroundColor: o.options.color || <span class="stringliteral">&#39;#ffff99&#39;</span></div>
<div class="line"><a name="l05048"></a><span class="lineno"> 5048</span>&#160;            })</div>
<div class="line"><a name="l05049"></a><span class="lineno"> 5049</span>&#160;            .animate(animation, {</div>
<div class="line"><a name="l05050"></a><span class="lineno"> 5050</span>&#160;                queue: <span class="keyword">false</span>,</div>
<div class="line"><a name="l05051"></a><span class="lineno"> 5051</span>&#160;                duration: o.duration,</div>
<div class="line"><a name="l05052"></a><span class="lineno"> 5052</span>&#160;                easing: o.options.easing,</div>
<div class="line"><a name="l05053"></a><span class="lineno"> 5053</span>&#160;                complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05054"></a><span class="lineno"> 5054</span>&#160;                    (mode == <span class="stringliteral">&#39;hide&#39;</span> &amp;&amp; elem.hide());</div>
<div class="line"><a name="l05055"></a><span class="lineno"> 5055</span>&#160;                    $.effects.restore(elem, props);</div>
<div class="line"><a name="l05056"></a><span class="lineno"> 5056</span>&#160;                    (mode == <span class="stringliteral">&#39;show&#39;</span> &amp;&amp; !$.support.opacity &amp;&amp; this.style.removeAttribute(<span class="stringliteral">&#39;filter&#39;</span>));</div>
<div class="line"><a name="l05057"></a><span class="lineno"> 5057</span>&#160;                    (o.callback &amp;&amp; o.callback.apply(<span class="keyword">this</span>, arguments));</div>
<div class="line"><a name="l05058"></a><span class="lineno"> 5058</span>&#160;                    elem.dequeue();</div>
<div class="line"><a name="l05059"></a><span class="lineno"> 5059</span>&#160;                }</div>
<div class="line"><a name="l05060"></a><span class="lineno"> 5060</span>&#160;            });</div>
<div class="line"><a name="l05061"></a><span class="lineno"> 5061</span>&#160;    });</div>
<div class="line"><a name="l05062"></a><span class="lineno"> 5062</span>&#160;};</div>
<div class="line"><a name="l05063"></a><span class="lineno"> 5063</span>&#160;</div>
<div class="line"><a name="l05064"></a><span class="lineno"> 5064</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05065"></a><span class="lineno"> 5065</span>&#160;</div>
<div class="line"><a name="l05066"></a><span class="lineno"> 5066</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05067"></a><span class="lineno"> 5067</span>&#160;</div>
<div class="line"><a name="l05068"></a><span class="lineno"> 5068</span>&#160;$.effects.pulsate = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05069"></a><span class="lineno"> 5069</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05070"></a><span class="lineno"> 5070</span>&#160;        var elem = $(<span class="keyword">this</span>),</div>
<div class="line"><a name="l05071"></a><span class="lineno"> 5071</span>&#160;            mode = $.effects.setMode(elem, o.options.mode || <span class="stringliteral">&#39;show&#39;</span>),</div>
<div class="line"><a name="l05072"></a><span class="lineno"> 5072</span>&#160;            times = ((o.options.times || 5) * 2) - 1,</div>
<div class="line"><a name="l05073"></a><span class="lineno"> 5073</span>&#160;            duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,</div>
<div class="line"><a name="l05074"></a><span class="lineno"> 5074</span>&#160;            isVisible = elem.is(<span class="stringliteral">&#39;:visible&#39;</span>),</div>
<div class="line"><a name="l05075"></a><span class="lineno"> 5075</span>&#160;            animateTo = 0;</div>
<div class="line"><a name="l05076"></a><span class="lineno"> 5076</span>&#160;</div>
<div class="line"><a name="l05077"></a><span class="lineno"> 5077</span>&#160;        <span class="keywordflow">if</span> (!isVisible) {</div>
<div class="line"><a name="l05078"></a><span class="lineno"> 5078</span>&#160;            elem.css(<span class="stringliteral">&#39;opacity&#39;</span>, 0).show();</div>
<div class="line"><a name="l05079"></a><span class="lineno"> 5079</span>&#160;            animateTo = 1;</div>
<div class="line"><a name="l05080"></a><span class="lineno"> 5080</span>&#160;        }</div>
<div class="line"><a name="l05081"></a><span class="lineno"> 5081</span>&#160;</div>
<div class="line"><a name="l05082"></a><span class="lineno"> 5082</span>&#160;        <span class="keywordflow">if</span> ((mode == <span class="stringliteral">&#39;hide&#39;</span> &amp;&amp; isVisible) || (mode == <span class="stringliteral">&#39;show&#39;</span> &amp;&amp; !isVisible)) {</div>
<div class="line"><a name="l05083"></a><span class="lineno"> 5083</span>&#160;            times--;</div>
<div class="line"><a name="l05084"></a><span class="lineno"> 5084</span>&#160;        }</div>
<div class="line"><a name="l05085"></a><span class="lineno"> 5085</span>&#160;</div>
<div class="line"><a name="l05086"></a><span class="lineno"> 5086</span>&#160;        <span class="keywordflow">for</span> (var i = 0; i &lt; times; i++) {</div>
<div class="line"><a name="l05087"></a><span class="lineno"> 5087</span>&#160;            elem.animate({ opacity: animateTo }, duration, o.options.easing);</div>
<div class="line"><a name="l05088"></a><span class="lineno"> 5088</span>&#160;            animateTo = (animateTo + 1) % 2;</div>
<div class="line"><a name="l05089"></a><span class="lineno"> 5089</span>&#160;        }</div>
<div class="line"><a name="l05090"></a><span class="lineno"> 5090</span>&#160;</div>
<div class="line"><a name="l05091"></a><span class="lineno"> 5091</span>&#160;        elem.animate({ opacity: animateTo }, duration, o.options.easing, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05092"></a><span class="lineno"> 5092</span>&#160;            <span class="keywordflow">if</span> (animateTo == 0) {</div>
<div class="line"><a name="l05093"></a><span class="lineno"> 5093</span>&#160;                elem.hide();</div>
<div class="line"><a name="l05094"></a><span class="lineno"> 5094</span>&#160;            }</div>
<div class="line"><a name="l05095"></a><span class="lineno"> 5095</span>&#160;            (o.callback &amp;&amp; o.callback.apply(<span class="keyword">this</span>, arguments));</div>
<div class="line"><a name="l05096"></a><span class="lineno"> 5096</span>&#160;        });</div>
<div class="line"><a name="l05097"></a><span class="lineno"> 5097</span>&#160;</div>
<div class="line"><a name="l05098"></a><span class="lineno"> 5098</span>&#160;        elem</div>
<div class="line"><a name="l05099"></a><span class="lineno"> 5099</span>&#160;            .queue(<span class="stringliteral">&#39;fx&#39;</span>, <span class="keyword">function</span>() { elem.dequeue(); })</div>
<div class="line"><a name="l05100"></a><span class="lineno"> 5100</span>&#160;            .dequeue();</div>
<div class="line"><a name="l05101"></a><span class="lineno"> 5101</span>&#160;    });</div>
<div class="line"><a name="l05102"></a><span class="lineno"> 5102</span>&#160;};</div>
<div class="line"><a name="l05103"></a><span class="lineno"> 5103</span>&#160;</div>
<div class="line"><a name="l05104"></a><span class="lineno"> 5104</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05105"></a><span class="lineno"> 5105</span>&#160;</div>
<div class="line"><a name="l05106"></a><span class="lineno"> 5106</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05107"></a><span class="lineno"> 5107</span>&#160;</div>
<div class="line"><a name="l05108"></a><span class="lineno"> 5108</span>&#160;$.effects.puff = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05109"></a><span class="lineno"> 5109</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05110"></a><span class="lineno"> 5110</span>&#160;        var elem = $(<span class="keyword">this</span>),</div>
<div class="line"><a name="l05111"></a><span class="lineno"> 5111</span>&#160;            mode = $.effects.setMode(elem, o.options.mode || <span class="stringliteral">&#39;hide&#39;</span>),</div>
<div class="line"><a name="l05112"></a><span class="lineno"> 5112</span>&#160;            percent = parseInt(o.options.percent, 10) || 150,</div>
<div class="line"><a name="l05113"></a><span class="lineno"> 5113</span>&#160;            factor = percent / 100,</div>
<div class="line"><a name="l05114"></a><span class="lineno"> 5114</span>&#160;            original = { height: elem.height(), width: elem.width() };</div>
<div class="line"><a name="l05115"></a><span class="lineno"> 5115</span>&#160;</div>
<div class="line"><a name="l05116"></a><span class="lineno"> 5116</span>&#160;        $.extend(o.options, {</div>
<div class="line"><a name="l05117"></a><span class="lineno"> 5117</span>&#160;            fade: <span class="keyword">true</span>,</div>
<div class="line"><a name="l05118"></a><span class="lineno"> 5118</span>&#160;            mode: mode,</div>
<div class="line"><a name="l05119"></a><span class="lineno"> 5119</span>&#160;            percent: mode == <span class="stringliteral">&#39;hide&#39;</span> ? percent : 100,</div>
<div class="line"><a name="l05120"></a><span class="lineno"> 5120</span>&#160;            from: mode == <span class="stringliteral">&#39;hide&#39;</span></div>
<div class="line"><a name="l05121"></a><span class="lineno"> 5121</span>&#160;                ? original</div>
<div class="line"><a name="l05122"></a><span class="lineno"> 5122</span>&#160;                : {</div>
<div class="line"><a name="l05123"></a><span class="lineno"> 5123</span>&#160;                    height: original.height * factor,</div>
<div class="line"><a name="l05124"></a><span class="lineno"> 5124</span>&#160;                    width: original.width * factor</div>
<div class="line"><a name="l05125"></a><span class="lineno"> 5125</span>&#160;                }</div>
<div class="line"><a name="l05126"></a><span class="lineno"> 5126</span>&#160;        });</div>
<div class="line"><a name="l05127"></a><span class="lineno"> 5127</span>&#160;</div>
<div class="line"><a name="l05128"></a><span class="lineno"> 5128</span>&#160;        elem.effect(<span class="stringliteral">&#39;scale&#39;</span>, o.options, o.duration, o.callback);</div>
<div class="line"><a name="l05129"></a><span class="lineno"> 5129</span>&#160;        elem.dequeue();</div>
<div class="line"><a name="l05130"></a><span class="lineno"> 5130</span>&#160;    });</div>
<div class="line"><a name="l05131"></a><span class="lineno"> 5131</span>&#160;};</div>
<div class="line"><a name="l05132"></a><span class="lineno"> 5132</span>&#160;</div>
<div class="line"><a name="l05133"></a><span class="lineno"> 5133</span>&#160;$.effects.scale = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05134"></a><span class="lineno"> 5134</span>&#160;</div>
<div class="line"><a name="l05135"></a><span class="lineno"> 5135</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05136"></a><span class="lineno"> 5136</span>&#160;</div>
<div class="line"><a name="l05137"></a><span class="lineno"> 5137</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l05138"></a><span class="lineno"> 5138</span>&#160;        var el = $(<span class="keyword">this</span>);</div>
<div class="line"><a name="l05139"></a><span class="lineno"> 5139</span>&#160;</div>
<div class="line"><a name="l05140"></a><span class="lineno"> 5140</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l05141"></a><span class="lineno"> 5141</span>&#160;        var options = $.extend(<span class="keyword">true</span>, {}, o.options);</div>
<div class="line"><a name="l05142"></a><span class="lineno"> 5142</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;effect&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l05143"></a><span class="lineno"> 5143</span>&#160;        var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == <span class="stringliteral">&#39;hide&#39;</span> ? 0 : 100)); <span class="comment">// Set default scaling percent</span></div>
<div class="line"><a name="l05144"></a><span class="lineno"> 5144</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;both&#39;</span>; <span class="comment">// Set default axis</span></div>
<div class="line"><a name="l05145"></a><span class="lineno"> 5145</span>&#160;        var origin = o.options.origin; <span class="comment">// The origin of the scaling</span></div>
<div class="line"><a name="l05146"></a><span class="lineno"> 5146</span>&#160;        <span class="keywordflow">if</span> (mode != <span class="stringliteral">&#39;effect&#39;</span>) { <span class="comment">// Set default origin and restore for show/hide</span></div>
<div class="line"><a name="l05147"></a><span class="lineno"> 5147</span>&#160;            options.origin = origin || [<span class="stringliteral">&#39;middle&#39;</span>,<span class="stringliteral">&#39;center&#39;</span>];</div>
<div class="line"><a name="l05148"></a><span class="lineno"> 5148</span>&#160;            options.restore = <span class="keyword">true</span>;</div>
<div class="line"><a name="l05149"></a><span class="lineno"> 5149</span>&#160;        }</div>
<div class="line"><a name="l05150"></a><span class="lineno"> 5150</span>&#160;        var original = {height: el.height(), width: el.width()}; <span class="comment">// Save original</span></div>
<div class="line"><a name="l05151"></a><span class="lineno"> 5151</span>&#160;        el.from = o.options.from || (mode == <span class="stringliteral">&#39;show&#39;</span> ? {height: 0, width: 0} : original); <span class="comment">// Default from state</span></div>
<div class="line"><a name="l05152"></a><span class="lineno"> 5152</span>&#160;</div>
<div class="line"><a name="l05153"></a><span class="lineno"> 5153</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l05154"></a><span class="lineno"> 5154</span>&#160;        var factor = { <span class="comment">// Set scaling factor</span></div>
<div class="line"><a name="l05155"></a><span class="lineno"> 5155</span>&#160;            y: direction != <span class="stringliteral">&#39;horizontal&#39;</span> ? (percent / 100) : 1,</div>
<div class="line"><a name="l05156"></a><span class="lineno"> 5156</span>&#160;            x: direction != <span class="stringliteral">&#39;vertical&#39;</span> ? (percent / 100) : 1</div>
<div class="line"><a name="l05157"></a><span class="lineno"> 5157</span>&#160;        };</div>
<div class="line"><a name="l05158"></a><span class="lineno"> 5158</span>&#160;        el.to = {height: original.height * factor.y, width: original.width * factor.x}; <span class="comment">// Set to state</span></div>
<div class="line"><a name="l05159"></a><span class="lineno"> 5159</span>&#160;</div>
<div class="line"><a name="l05160"></a><span class="lineno"> 5160</span>&#160;        <span class="keywordflow">if</span> (o.options.fade) { <span class="comment">// Fade option to support puff</span></div>
<div class="line"><a name="l05161"></a><span class="lineno"> 5161</span>&#160;            <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;show&#39;</span>) {el.from.opacity = 0; el.to.opacity = 1;};</div>
<div class="line"><a name="l05162"></a><span class="lineno"> 5162</span>&#160;            <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;hide&#39;</span>) {el.from.opacity = 1; el.to.opacity = 0;};</div>
<div class="line"><a name="l05163"></a><span class="lineno"> 5163</span>&#160;        };</div>
<div class="line"><a name="l05164"></a><span class="lineno"> 5164</span>&#160;</div>
<div class="line"><a name="l05165"></a><span class="lineno"> 5165</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l05166"></a><span class="lineno"> 5166</span>&#160;        options.from = el.from; options.to = el.to; options.mode = mode;</div>
<div class="line"><a name="l05167"></a><span class="lineno"> 5167</span>&#160;</div>
<div class="line"><a name="l05168"></a><span class="lineno"> 5168</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l05169"></a><span class="lineno"> 5169</span>&#160;        el.effect(<span class="stringliteral">&#39;size&#39;</span>, options, o.duration, o.callback);</div>
<div class="line"><a name="l05170"></a><span class="lineno"> 5170</span>&#160;        el.dequeue();</div>
<div class="line"><a name="l05171"></a><span class="lineno"> 5171</span>&#160;    });</div>
<div class="line"><a name="l05172"></a><span class="lineno"> 5172</span>&#160;</div>
<div class="line"><a name="l05173"></a><span class="lineno"> 5173</span>&#160;};</div>
<div class="line"><a name="l05174"></a><span class="lineno"> 5174</span>&#160;</div>
<div class="line"><a name="l05175"></a><span class="lineno"> 5175</span>&#160;$.effects.size = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05176"></a><span class="lineno"> 5176</span>&#160;</div>
<div class="line"><a name="l05177"></a><span class="lineno"> 5177</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05178"></a><span class="lineno"> 5178</span>&#160;</div>
<div class="line"><a name="l05179"></a><span class="lineno"> 5179</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l05180"></a><span class="lineno"> 5180</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>,<span class="stringliteral">&#39;width&#39;</span>,<span class="stringliteral">&#39;height&#39;</span>,<span class="stringliteral">&#39;overflow&#39;</span>,<span class="stringliteral">&#39;opacity&#39;</span>];</div>
<div class="line"><a name="l05181"></a><span class="lineno"> 5181</span>&#160;        var props1 = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>,<span class="stringliteral">&#39;overflow&#39;</span>,<span class="stringliteral">&#39;opacity&#39;</span>]; <span class="comment">// Always restore</span></div>
<div class="line"><a name="l05182"></a><span class="lineno"> 5182</span>&#160;        var props2 = [<span class="stringliteral">&#39;width&#39;</span>,<span class="stringliteral">&#39;height&#39;</span>,<span class="stringliteral">&#39;overflow&#39;</span>]; <span class="comment">// Copy for children</span></div>
<div class="line"><a name="l05183"></a><span class="lineno"> 5183</span>&#160;        var cProps = [<span class="stringliteral">&#39;fontSize&#39;</span>];</div>
<div class="line"><a name="l05184"></a><span class="lineno"> 5184</span>&#160;        var vProps = [<span class="stringliteral">&#39;borderTopWidth&#39;</span>, <span class="stringliteral">&#39;borderBottomWidth&#39;</span>, <span class="stringliteral">&#39;paddingTop&#39;</span>, <span class="stringliteral">&#39;paddingBottom&#39;</span>];</div>
<div class="line"><a name="l05185"></a><span class="lineno"> 5185</span>&#160;        var hProps = [<span class="stringliteral">&#39;borderLeftWidth&#39;</span>, <span class="stringliteral">&#39;borderRightWidth&#39;</span>, <span class="stringliteral">&#39;paddingLeft&#39;</span>, <span class="stringliteral">&#39;paddingRight&#39;</span>];</div>
<div class="line"><a name="l05186"></a><span class="lineno"> 5186</span>&#160;</div>
<div class="line"><a name="l05187"></a><span class="lineno"> 5187</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l05188"></a><span class="lineno"> 5188</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;effect&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l05189"></a><span class="lineno"> 5189</span>&#160;        var restore = o.options.restore || <span class="keyword">false</span>; <span class="comment">// Default restore</span></div>
<div class="line"><a name="l05190"></a><span class="lineno"> 5190</span>&#160;        var scale = o.options.scale || <span class="stringliteral">&#39;both&#39;</span>; <span class="comment">// Default scale mode</span></div>
<div class="line"><a name="l05191"></a><span class="lineno"> 5191</span>&#160;        var origin = o.options.origin; <span class="comment">// The origin of the sizing</span></div>
<div class="line"><a name="l05192"></a><span class="lineno"> 5192</span>&#160;        var original = {height: el.height(), width: el.width()}; <span class="comment">// Save original</span></div>
<div class="line"><a name="l05193"></a><span class="lineno"> 5193</span>&#160;        el.from = o.options.from || original; <span class="comment">// Default from state</span></div>
<div class="line"><a name="l05194"></a><span class="lineno"> 5194</span>&#160;        el.to = o.options.to || original; <span class="comment">// Default to state</span></div>
<div class="line"><a name="l05195"></a><span class="lineno"> 5195</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l05196"></a><span class="lineno"> 5196</span>&#160;        <span class="keywordflow">if</span> (origin) { <span class="comment">// Calculate baseline shifts</span></div>
<div class="line"><a name="l05197"></a><span class="lineno"> 5197</span>&#160;            var baseline = $.effects.getBaseline(origin, original);</div>
<div class="line"><a name="l05198"></a><span class="lineno"> 5198</span>&#160;            el.from.top = (original.height - el.from.height) * baseline.y;</div>
<div class="line"><a name="l05199"></a><span class="lineno"> 5199</span>&#160;            el.from.left = (original.width - el.from.width) * baseline.x;</div>
<div class="line"><a name="l05200"></a><span class="lineno"> 5200</span>&#160;            el.to.top = (original.height - el.to.height) * baseline.y;</div>
<div class="line"><a name="l05201"></a><span class="lineno"> 5201</span>&#160;            el.to.left = (original.width - el.to.width) * baseline.x;</div>
<div class="line"><a name="l05202"></a><span class="lineno"> 5202</span>&#160;        };</div>
<div class="line"><a name="l05203"></a><span class="lineno"> 5203</span>&#160;        var factor = { <span class="comment">// Set scaling factor</span></div>
<div class="line"><a name="l05204"></a><span class="lineno"> 5204</span>&#160;            from: {y: el.from.height / original.height, x: el.from.width / original.width},</div>
<div class="line"><a name="l05205"></a><span class="lineno"> 5205</span>&#160;            to: {y: el.to.height / original.height, x: el.to.width / original.width}</div>
<div class="line"><a name="l05206"></a><span class="lineno"> 5206</span>&#160;        };</div>
<div class="line"><a name="l05207"></a><span class="lineno"> 5207</span>&#160;        <span class="keywordflow">if</span> (scale == <span class="stringliteral">&#39;box&#39;</span> || scale == <span class="stringliteral">&#39;both&#39;</span>) { <span class="comment">// Scale the css box</span></div>
<div class="line"><a name="l05208"></a><span class="lineno"> 5208</span>&#160;            <span class="keywordflow">if</span> (factor.from.y != factor.to.y) { <span class="comment">// Vertical props scaling</span></div>
<div class="line"><a name="l05209"></a><span class="lineno"> 5209</span>&#160;                props = props.concat(vProps);</div>
<div class="line"><a name="l05210"></a><span class="lineno"> 5210</span>&#160;                el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);</div>
<div class="line"><a name="l05211"></a><span class="lineno"> 5211</span>&#160;                el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);</div>
<div class="line"><a name="l05212"></a><span class="lineno"> 5212</span>&#160;            };</div>
<div class="line"><a name="l05213"></a><span class="lineno"> 5213</span>&#160;            <span class="keywordflow">if</span> (factor.from.x != factor.to.x) { <span class="comment">// Horizontal props scaling</span></div>
<div class="line"><a name="l05214"></a><span class="lineno"> 5214</span>&#160;                props = props.concat(hProps);</div>
<div class="line"><a name="l05215"></a><span class="lineno"> 5215</span>&#160;                el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);</div>
<div class="line"><a name="l05216"></a><span class="lineno"> 5216</span>&#160;                el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);</div>
<div class="line"><a name="l05217"></a><span class="lineno"> 5217</span>&#160;            };</div>
<div class="line"><a name="l05218"></a><span class="lineno"> 5218</span>&#160;        };</div>
<div class="line"><a name="l05219"></a><span class="lineno"> 5219</span>&#160;        <span class="keywordflow">if</span> (scale == <span class="stringliteral">&#39;content&#39;</span> || scale == <span class="stringliteral">&#39;both&#39;</span>) { <span class="comment">// Scale the content</span></div>
<div class="line"><a name="l05220"></a><span class="lineno"> 5220</span>&#160;            <span class="keywordflow">if</span> (factor.from.y != factor.to.y) { <span class="comment">// Vertical props scaling</span></div>
<div class="line"><a name="l05221"></a><span class="lineno"> 5221</span>&#160;                props = props.concat(cProps);</div>
<div class="line"><a name="l05222"></a><span class="lineno"> 5222</span>&#160;                el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);</div>
<div class="line"><a name="l05223"></a><span class="lineno"> 5223</span>&#160;                el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);</div>
<div class="line"><a name="l05224"></a><span class="lineno"> 5224</span>&#160;            };</div>
<div class="line"><a name="l05225"></a><span class="lineno"> 5225</span>&#160;        };</div>
<div class="line"><a name="l05226"></a><span class="lineno"> 5226</span>&#160;        $.effects.save(el, restore ? props : props1); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l05227"></a><span class="lineno"> 5227</span>&#160;        $.effects.createWrapper(el); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l05228"></a><span class="lineno"> 5228</span>&#160;        el.css(<span class="stringliteral">&#39;overflow&#39;</span>,<span class="stringliteral">&#39;hidden&#39;</span>).css(el.from); <span class="comment">// Shift</span></div>
<div class="line"><a name="l05229"></a><span class="lineno"> 5229</span>&#160;</div>
<div class="line"><a name="l05230"></a><span class="lineno"> 5230</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l05231"></a><span class="lineno"> 5231</span>&#160;        <span class="keywordflow">if</span> (scale == <span class="stringliteral">&#39;content&#39;</span> || scale == <span class="stringliteral">&#39;both&#39;</span>) { <span class="comment">// Scale the children</span></div>
<div class="line"><a name="l05232"></a><span class="lineno"> 5232</span>&#160;            vProps = vProps.concat([<span class="stringliteral">&#39;marginTop&#39;</span>,<span class="stringliteral">&#39;marginBottom&#39;</span>]).concat(cProps); <span class="comment">// Add margins/font-size</span></div>
<div class="line"><a name="l05233"></a><span class="lineno"> 5233</span>&#160;            hProps = hProps.concat([<span class="stringliteral">&#39;marginLeft&#39;</span>,<span class="stringliteral">&#39;marginRight&#39;</span>]); <span class="comment">// Add margins</span></div>
<div class="line"><a name="l05234"></a><span class="lineno"> 5234</span>&#160;            props2 = props.concat(vProps).concat(hProps); <span class="comment">// Concat</span></div>
<div class="line"><a name="l05235"></a><span class="lineno"> 5235</span>&#160;            el.find(<span class="stringliteral">&quot;*[width]&quot;</span>).each(<span class="keyword">function</span>(){</div>
<div class="line"><a name="l05236"></a><span class="lineno"> 5236</span>&#160;                var child = $(<span class="keyword">this</span>);</div>
<div class="line"><a name="l05237"></a><span class="lineno"> 5237</span>&#160;                <span class="keywordflow">if</span> (restore) $.effects.save(child, props2);</div>
<div class="line"><a name="l05238"></a><span class="lineno"> 5238</span>&#160;                var c_original = {height: child.height(), width: child.width()}; <span class="comment">// Save original</span></div>
<div class="line"><a name="l05239"></a><span class="lineno"> 5239</span>&#160;                child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};</div>
<div class="line"><a name="l05240"></a><span class="lineno"> 5240</span>&#160;                child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};</div>
<div class="line"><a name="l05241"></a><span class="lineno"> 5241</span>&#160;                <span class="keywordflow">if</span> (factor.from.y != factor.to.y) { <span class="comment">// Vertical props scaling</span></div>
<div class="line"><a name="l05242"></a><span class="lineno"> 5242</span>&#160;                    child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);</div>
<div class="line"><a name="l05243"></a><span class="lineno"> 5243</span>&#160;                    child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);</div>
<div class="line"><a name="l05244"></a><span class="lineno"> 5244</span>&#160;                };</div>
<div class="line"><a name="l05245"></a><span class="lineno"> 5245</span>&#160;                <span class="keywordflow">if</span> (factor.from.x != factor.to.x) { <span class="comment">// Horizontal props scaling</span></div>
<div class="line"><a name="l05246"></a><span class="lineno"> 5246</span>&#160;                    child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);</div>
<div class="line"><a name="l05247"></a><span class="lineno"> 5247</span>&#160;                    child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);</div>
<div class="line"><a name="l05248"></a><span class="lineno"> 5248</span>&#160;                };</div>
<div class="line"><a name="l05249"></a><span class="lineno"> 5249</span>&#160;                child.css(child.from); <span class="comment">// Shift children</span></div>
<div class="line"><a name="l05250"></a><span class="lineno"> 5250</span>&#160;                child.animate(child.to, o.duration, o.options.easing, <span class="keyword">function</span>(){</div>
<div class="line"><a name="l05251"></a><span class="lineno"> 5251</span>&#160;                    if (restore) $.effects.restore(child, props2); <span class="comment">// Restore children</span></div>
<div class="line"><a name="l05252"></a><span class="lineno"> 5252</span>&#160;                }); <span class="comment">// Animate children</span></div>
<div class="line"><a name="l05253"></a><span class="lineno"> 5253</span>&#160;            });</div>
<div class="line"><a name="l05254"></a><span class="lineno"> 5254</span>&#160;        };</div>
<div class="line"><a name="l05255"></a><span class="lineno"> 5255</span>&#160;</div>
<div class="line"><a name="l05256"></a><span class="lineno"> 5256</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l05257"></a><span class="lineno"> 5257</span>&#160;        el.animate(el.to, { queue: <span class="keyword">false</span>, duration: o.duration, easing: o.options.easing, complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05258"></a><span class="lineno"> 5258</span>&#160;            if (el.to.opacity === 0) {</div>
<div class="line"><a name="l05259"></a><span class="lineno"> 5259</span>&#160;                el.css(<span class="stringliteral">&#39;opacity&#39;</span>, el.from.opacity);</div>
<div class="line"><a name="l05260"></a><span class="lineno"> 5260</span>&#160;            }</div>
<div class="line"><a name="l05261"></a><span class="lineno"> 5261</span>&#160;            <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;hide&#39;</span>) el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l05262"></a><span class="lineno"> 5262</span>&#160;            $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l05263"></a><span class="lineno"> 5263</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(<span class="keyword">this</span>, arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l05264"></a><span class="lineno"> 5264</span>&#160;            el.dequeue();</div>
<div class="line"><a name="l05265"></a><span class="lineno"> 5265</span>&#160;        }});</div>
<div class="line"><a name="l05266"></a><span class="lineno"> 5266</span>&#160;</div>
<div class="line"><a name="l05267"></a><span class="lineno"> 5267</span>&#160;    });</div>
<div class="line"><a name="l05268"></a><span class="lineno"> 5268</span>&#160;</div>
<div class="line"><a name="l05269"></a><span class="lineno"> 5269</span>&#160;};</div>
<div class="line"><a name="l05270"></a><span class="lineno"> 5270</span>&#160;</div>
<div class="line"><a name="l05271"></a><span class="lineno"> 5271</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05272"></a><span class="lineno"> 5272</span>&#160;</div>
<div class="line"><a name="l05273"></a><span class="lineno"> 5273</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05274"></a><span class="lineno"> 5274</span>&#160;</div>
<div class="line"><a name="l05275"></a><span class="lineno"> 5275</span>&#160;$.effects.shake = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05276"></a><span class="lineno"> 5276</span>&#160;</div>
<div class="line"><a name="l05277"></a><span class="lineno"> 5277</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05278"></a><span class="lineno"> 5278</span>&#160;</div>
<div class="line"><a name="l05279"></a><span class="lineno"> 5279</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l05280"></a><span class="lineno"> 5280</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>];</div>
<div class="line"><a name="l05281"></a><span class="lineno"> 5281</span>&#160;</div>
<div class="line"><a name="l05282"></a><span class="lineno"> 5282</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l05283"></a><span class="lineno"> 5283</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;effect&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l05284"></a><span class="lineno"> 5284</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;left&#39;</span>; <span class="comment">// Default direction</span></div>
<div class="line"><a name="l05285"></a><span class="lineno"> 5285</span>&#160;        var distance = o.options.distance || 20; <span class="comment">// Default distance</span></div>
<div class="line"><a name="l05286"></a><span class="lineno"> 5286</span>&#160;        var times = o.options.times || 3; <span class="comment">// Default # of times</span></div>
<div class="line"><a name="l05287"></a><span class="lineno"> 5287</span>&#160;        var speed = o.duration || o.options.duration || 140; <span class="comment">// Default speed per shake</span></div>
<div class="line"><a name="l05288"></a><span class="lineno"> 5288</span>&#160;</div>
<div class="line"><a name="l05289"></a><span class="lineno"> 5289</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l05290"></a><span class="lineno"> 5290</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l05291"></a><span class="lineno"> 5291</span>&#160;        $.effects.createWrapper(el); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l05292"></a><span class="lineno"> 5292</span>&#160;        var ref = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;down&#39;</span>) ? <span class="stringliteral">&#39;top&#39;</span> : <span class="stringliteral">&#39;left&#39;</span>;</div>
<div class="line"><a name="l05293"></a><span class="lineno"> 5293</span>&#160;        var motion = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;left&#39;</span>) ? <span class="stringliteral">&#39;pos&#39;</span> : <span class="stringliteral">&#39;neg&#39;</span>;</div>
<div class="line"><a name="l05294"></a><span class="lineno"> 5294</span>&#160;</div>
<div class="line"><a name="l05295"></a><span class="lineno"> 5295</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l05296"></a><span class="lineno"> 5296</span>&#160;        var animation = {}, animation1 = {}, animation2 = {};</div>
<div class="line"><a name="l05297"></a><span class="lineno"> 5297</span>&#160;        animation[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>)  + distance;</div>
<div class="line"><a name="l05298"></a><span class="lineno"> 5298</span>&#160;        animation1[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;+=&#39;</span> : <span class="stringliteral">&#39;-=&#39;</span>)  + distance * 2;</div>
<div class="line"><a name="l05299"></a><span class="lineno"> 5299</span>&#160;        animation2[ref] = (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>)  + distance * 2;</div>
<div class="line"><a name="l05300"></a><span class="lineno"> 5300</span>&#160;</div>
<div class="line"><a name="l05301"></a><span class="lineno"> 5301</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l05302"></a><span class="lineno"> 5302</span>&#160;        el.animate(animation, speed, o.options.easing);</div>
<div class="line"><a name="l05303"></a><span class="lineno"> 5303</span>&#160;        <span class="keywordflow">for</span> (var i = 1; i &lt; times; i++) { <span class="comment">// Shakes</span></div>
<div class="line"><a name="l05304"></a><span class="lineno"> 5304</span>&#160;            el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);</div>
<div class="line"><a name="l05305"></a><span class="lineno"> 5305</span>&#160;        };</div>
<div class="line"><a name="l05306"></a><span class="lineno"> 5306</span>&#160;        el.animate(animation1, speed, o.options.easing).</div>
<div class="line"><a name="l05307"></a><span class="lineno"> 5307</span>&#160;        animate(animation, speed / 2, o.options.easing, <span class="keyword">function</span>(){ <span class="comment">// Last shake</span></div>
<div class="line"><a name="l05308"></a><span class="lineno"> 5308</span>&#160;            $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l05309"></a><span class="lineno"> 5309</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(<span class="keyword">this</span>, arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l05310"></a><span class="lineno"> 5310</span>&#160;        });</div>
<div class="line"><a name="l05311"></a><span class="lineno"> 5311</span>&#160;        el.queue(<span class="stringliteral">&#39;fx&#39;</span>, <span class="keyword">function</span>() { el.dequeue(); });</div>
<div class="line"><a name="l05312"></a><span class="lineno"> 5312</span>&#160;        el.dequeue();</div>
<div class="line"><a name="l05313"></a><span class="lineno"> 5313</span>&#160;    });</div>
<div class="line"><a name="l05314"></a><span class="lineno"> 5314</span>&#160;</div>
<div class="line"><a name="l05315"></a><span class="lineno"> 5315</span>&#160;};</div>
<div class="line"><a name="l05316"></a><span class="lineno"> 5316</span>&#160;</div>
<div class="line"><a name="l05317"></a><span class="lineno"> 5317</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05318"></a><span class="lineno"> 5318</span>&#160;</div>
<div class="line"><a name="l05319"></a><span class="lineno"> 5319</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05320"></a><span class="lineno"> 5320</span>&#160;</div>
<div class="line"><a name="l05321"></a><span class="lineno"> 5321</span>&#160;$.effects.slide = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05322"></a><span class="lineno"> 5322</span>&#160;</div>
<div class="line"><a name="l05323"></a><span class="lineno"> 5323</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05324"></a><span class="lineno"> 5324</span>&#160;</div>
<div class="line"><a name="l05325"></a><span class="lineno"> 5325</span>&#160;        <span class="comment">// Create element</span></div>
<div class="line"><a name="l05326"></a><span class="lineno"> 5326</span>&#160;        var el = $(<span class="keyword">this</span>), props = [<span class="stringliteral">&#39;position&#39;</span>,<span class="stringliteral">&#39;top&#39;</span>,<span class="stringliteral">&#39;bottom&#39;</span>,<span class="stringliteral">&#39;left&#39;</span>,<span class="stringliteral">&#39;right&#39;</span>];</div>
<div class="line"><a name="l05327"></a><span class="lineno"> 5327</span>&#160;</div>
<div class="line"><a name="l05328"></a><span class="lineno"> 5328</span>&#160;        <span class="comment">// Set options</span></div>
<div class="line"><a name="l05329"></a><span class="lineno"> 5329</span>&#160;        var mode = $.effects.setMode(el, o.options.mode || <span class="stringliteral">&#39;show&#39;</span>); <span class="comment">// Set Mode</span></div>
<div class="line"><a name="l05330"></a><span class="lineno"> 5330</span>&#160;        var direction = o.options.direction || <span class="stringliteral">&#39;left&#39;</span>; <span class="comment">// Default Direction</span></div>
<div class="line"><a name="l05331"></a><span class="lineno"> 5331</span>&#160;</div>
<div class="line"><a name="l05332"></a><span class="lineno"> 5332</span>&#160;        <span class="comment">// Adjust</span></div>
<div class="line"><a name="l05333"></a><span class="lineno"> 5333</span>&#160;        $.effects.save(el, props); el.show(); <span class="comment">// Save &amp; Show</span></div>
<div class="line"><a name="l05334"></a><span class="lineno"> 5334</span>&#160;        $.effects.createWrapper(el).css({overflow:<span class="stringliteral">&#39;hidden&#39;</span>}); <span class="comment">// Create Wrapper</span></div>
<div class="line"><a name="l05335"></a><span class="lineno"> 5335</span>&#160;        var ref = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;down&#39;</span>) ? <span class="stringliteral">&#39;top&#39;</span> : <span class="stringliteral">&#39;left&#39;</span>;</div>
<div class="line"><a name="l05336"></a><span class="lineno"> 5336</span>&#160;        var motion = (direction == <span class="stringliteral">&#39;up&#39;</span> || direction == <span class="stringliteral">&#39;left&#39;</span>) ? <span class="stringliteral">&#39;pos&#39;</span> : <span class="stringliteral">&#39;neg&#39;</span>;</div>
<div class="line"><a name="l05337"></a><span class="lineno"> 5337</span>&#160;        var distance = o.options.distance || (ref == <span class="stringliteral">&#39;top&#39;</span> ? el.outerHeight({margin:<span class="keyword">true</span>}) : el.outerWidth({margin:<span class="keyword">true</span>}));</div>
<div class="line"><a name="l05338"></a><span class="lineno"> 5338</span>&#160;        <span class="keywordflow">if</span> (mode == <span class="stringliteral">&#39;show&#39;</span>) el.css(ref, motion == <span class="stringliteral">&#39;pos&#39;</span> ? (isNaN(distance) ? <span class="stringliteral">&quot;-&quot;</span> + distance : -distance) : distance); <span class="comment">// Shift</span></div>
<div class="line"><a name="l05339"></a><span class="lineno"> 5339</span>&#160;</div>
<div class="line"><a name="l05340"></a><span class="lineno"> 5340</span>&#160;        <span class="comment">// Animation</span></div>
<div class="line"><a name="l05341"></a><span class="lineno"> 5341</span>&#160;        var animation = {};</div>
<div class="line"><a name="l05342"></a><span class="lineno"> 5342</span>&#160;        animation[ref] = (mode == <span class="stringliteral">&#39;show&#39;</span> ? (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;+=&#39;</span> : <span class="stringliteral">&#39;-=&#39;</span>) : (motion == <span class="stringliteral">&#39;pos&#39;</span> ? <span class="stringliteral">&#39;-=&#39;</span> : <span class="stringliteral">&#39;+=&#39;</span>)) + distance;</div>
<div class="line"><a name="l05343"></a><span class="lineno"> 5343</span>&#160;</div>
<div class="line"><a name="l05344"></a><span class="lineno"> 5344</span>&#160;        <span class="comment">// Animate</span></div>
<div class="line"><a name="l05345"></a><span class="lineno"> 5345</span>&#160;        el.animate(animation, { queue: <span class="keyword">false</span>, duration: o.duration, easing: o.options.easing, complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05346"></a><span class="lineno"> 5346</span>&#160;            <span class="keywordflow">if</span>(mode == <span class="stringliteral">&#39;hide&#39;</span>) el.hide(); <span class="comment">// Hide</span></div>
<div class="line"><a name="l05347"></a><span class="lineno"> 5347</span>&#160;            $.effects.restore(el, props); $.effects.removeWrapper(el); <span class="comment">// Restore</span></div>
<div class="line"><a name="l05348"></a><span class="lineno"> 5348</span>&#160;            <span class="keywordflow">if</span>(o.callback) o.callback.apply(<span class="keyword">this</span>, arguments); <span class="comment">// Callback</span></div>
<div class="line"><a name="l05349"></a><span class="lineno"> 5349</span>&#160;            el.dequeue();</div>
<div class="line"><a name="l05350"></a><span class="lineno"> 5350</span>&#160;        }});</div>
<div class="line"><a name="l05351"></a><span class="lineno"> 5351</span>&#160;</div>
<div class="line"><a name="l05352"></a><span class="lineno"> 5352</span>&#160;    });</div>
<div class="line"><a name="l05353"></a><span class="lineno"> 5353</span>&#160;</div>
<div class="line"><a name="l05354"></a><span class="lineno"> 5354</span>&#160;};</div>
<div class="line"><a name="l05355"></a><span class="lineno"> 5355</span>&#160;</div>
<div class="line"><a name="l05356"></a><span class="lineno"> 5356</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05357"></a><span class="lineno"> 5357</span>&#160;</div>
<div class="line"><a name="l05358"></a><span class="lineno"> 5358</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05359"></a><span class="lineno"> 5359</span>&#160;</div>
<div class="line"><a name="l05360"></a><span class="lineno"> 5360</span>&#160;$.effects.transfer = <span class="keyword">function</span>(o) {</div>
<div class="line"><a name="l05361"></a><span class="lineno"> 5361</span>&#160;    <span class="keywordflow">return</span> this.queue(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05362"></a><span class="lineno"> 5362</span>&#160;        var elem = $(<span class="keyword">this</span>),</div>
<div class="line"><a name="l05363"></a><span class="lineno"> 5363</span>&#160;            target = $(o.options.to),</div>
<div class="line"><a name="l05364"></a><span class="lineno"> 5364</span>&#160;            endPosition = target.offset(),</div>
<div class="line"><a name="l05365"></a><span class="lineno"> 5365</span>&#160;            animation = {</div>
<div class="line"><a name="l05366"></a><span class="lineno"> 5366</span>&#160;                top: endPosition.top,</div>
<div class="line"><a name="l05367"></a><span class="lineno"> 5367</span>&#160;                left: endPosition.left,</div>
<div class="line"><a name="l05368"></a><span class="lineno"> 5368</span>&#160;                height: target.innerHeight(),</div>
<div class="line"><a name="l05369"></a><span class="lineno"> 5369</span>&#160;                width: target.innerWidth()</div>
<div class="line"><a name="l05370"></a><span class="lineno"> 5370</span>&#160;            },</div>
<div class="line"><a name="l05371"></a><span class="lineno"> 5371</span>&#160;            startPosition = elem.offset(),</div>
<div class="line"><a name="l05372"></a><span class="lineno"> 5372</span>&#160;            transfer = $(<span class="stringliteral">&#39;&lt;div class=&quot;ui-effects-transfer&quot;&gt;&lt;/div&gt;&#39;</span>)</div>
<div class="line"><a name="l05373"></a><span class="lineno"> 5373</span>&#160;                .appendTo(document.body)</div>
<div class="line"><a name="l05374"></a><span class="lineno"> 5374</span>&#160;                .addClass(o.options.className)</div>
<div class="line"><a name="l05375"></a><span class="lineno"> 5375</span>&#160;                .css({</div>
<div class="line"><a name="l05376"></a><span class="lineno"> 5376</span>&#160;                    top: startPosition.top,</div>
<div class="line"><a name="l05377"></a><span class="lineno"> 5377</span>&#160;                    left: startPosition.left,</div>
<div class="line"><a name="l05378"></a><span class="lineno"> 5378</span>&#160;                    height: elem.innerHeight(),</div>
<div class="line"><a name="l05379"></a><span class="lineno"> 5379</span>&#160;                    width: elem.innerWidth(),</div>
<div class="line"><a name="l05380"></a><span class="lineno"> 5380</span>&#160;                    position: <span class="stringliteral">&#39;absolute&#39;</span></div>
<div class="line"><a name="l05381"></a><span class="lineno"> 5381</span>&#160;                })</div>
<div class="line"><a name="l05382"></a><span class="lineno"> 5382</span>&#160;                .animate(animation, o.duration, o.options.easing, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05383"></a><span class="lineno"> 5383</span>&#160;                    transfer.remove();</div>
<div class="line"><a name="l05384"></a><span class="lineno"> 5384</span>&#160;                    (o.callback &amp;&amp; o.callback.apply(elem[0], arguments));</div>
<div class="line"><a name="l05385"></a><span class="lineno"> 5385</span>&#160;                    elem.dequeue();</div>
<div class="line"><a name="l05386"></a><span class="lineno"> 5386</span>&#160;                });</div>
<div class="line"><a name="l05387"></a><span class="lineno"> 5387</span>&#160;    });</div>
<div class="line"><a name="l05388"></a><span class="lineno"> 5388</span>&#160;};</div>
<div class="line"><a name="l05389"></a><span class="lineno"> 5389</span>&#160;</div>
<div class="line"><a name="l05390"></a><span class="lineno"> 5390</span>&#160;})(jQuery);</div>
<div class="line"><a name="l05391"></a><span class="lineno"> 5391</span>&#160;</div>
<div class="line"><a name="l05392"></a><span class="lineno"> 5392</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05393"></a><span class="lineno"> 5393</span>&#160;</div>
<div class="line"><a name="l05394"></a><span class="lineno"> 5394</span>&#160;$.widget( <span class="stringliteral">&quot;ui.accordion&quot;</span>, {</div>
<div class="line"><a name="l05395"></a><span class="lineno"> 5395</span>&#160;    options: {</div>
<div class="line"><a name="l05396"></a><span class="lineno"> 5396</span>&#160;        active: 0,</div>
<div class="line"><a name="l05397"></a><span class="lineno"> 5397</span>&#160;        animated: <span class="stringliteral">&quot;slide&quot;</span>,</div>
<div class="line"><a name="l05398"></a><span class="lineno"> 5398</span>&#160;        autoHeight: <span class="keyword">true</span>,</div>
<div class="line"><a name="l05399"></a><span class="lineno"> 5399</span>&#160;        clearStyle: <span class="keyword">false</span>,</div>
<div class="line"><a name="l05400"></a><span class="lineno"> 5400</span>&#160;        collapsible: <span class="keyword">false</span>,</div>
<div class="line"><a name="l05401"></a><span class="lineno"> 5401</span>&#160;        <span class="keyword">event</span>: <span class="stringliteral">&quot;click&quot;</span>,</div>
<div class="line"><a name="l05402"></a><span class="lineno"> 5402</span>&#160;        fillSpace: <span class="keyword">false</span>,</div>
<div class="line"><a name="l05403"></a><span class="lineno"> 5403</span>&#160;        header: <span class="stringliteral">&quot;&gt; li &gt; :first-child,&gt; :not(li):even&quot;</span>,</div>
<div class="line"><a name="l05404"></a><span class="lineno"> 5404</span>&#160;        icons: {</div>
<div class="line"><a name="l05405"></a><span class="lineno"> 5405</span>&#160;            header: <span class="stringliteral">&quot;ui-icon-triangle-1-e&quot;</span>,</div>
<div class="line"><a name="l05406"></a><span class="lineno"> 5406</span>&#160;            headerSelected: <span class="stringliteral">&quot;ui-icon-triangle-1-s&quot;</span></div>
<div class="line"><a name="l05407"></a><span class="lineno"> 5407</span>&#160;        },</div>
<div class="line"><a name="l05408"></a><span class="lineno"> 5408</span>&#160;        navigation: <span class="keyword">false</span>,</div>
<div class="line"><a name="l05409"></a><span class="lineno"> 5409</span>&#160;        navigationFilter: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05410"></a><span class="lineno"> 5410</span>&#160;            <span class="keywordflow">return</span> this.href.toLowerCase() === location.href.toLowerCase();</div>
<div class="line"><a name="l05411"></a><span class="lineno"> 5411</span>&#160;        }</div>
<div class="line"><a name="l05412"></a><span class="lineno"> 5412</span>&#160;    },</div>
<div class="line"><a name="l05413"></a><span class="lineno"> 5413</span>&#160;</div>
<div class="line"><a name="l05414"></a><span class="lineno"> 5414</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05415"></a><span class="lineno"> 5415</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l05416"></a><span class="lineno"> 5416</span>&#160;            options = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l05417"></a><span class="lineno"> 5417</span>&#160;</div>
<div class="line"><a name="l05418"></a><span class="lineno"> 5418</span>&#160;        <span class="keyword">self</span>.running = 0;</div>
<div class="line"><a name="l05419"></a><span class="lineno"> 5419</span>&#160;</div>
<div class="line"><a name="l05420"></a><span class="lineno"> 5420</span>&#160;        <span class="keyword">self</span>.element</div>
<div class="line"><a name="l05421"></a><span class="lineno"> 5421</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-accordion ui-widget ui-helper-reset&quot;</span> )</div>
<div class="line"><a name="l05422"></a><span class="lineno"> 5422</span>&#160;            <span class="comment">// in lack of child-selectors in CSS</span></div>
<div class="line"><a name="l05423"></a><span class="lineno"> 5423</span>&#160;            <span class="comment">// we need to mark top-LIs in a UL-accordion for some IE-fix</span></div>
<div class="line"><a name="l05424"></a><span class="lineno"> 5424</span>&#160;            .children( <span class="stringliteral">&quot;li&quot;</span> )</div>
<div class="line"><a name="l05425"></a><span class="lineno"> 5425</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-accordion-li-fix&quot;</span> );</div>
<div class="line"><a name="l05426"></a><span class="lineno"> 5426</span>&#160;</div>
<div class="line"><a name="l05427"></a><span class="lineno"> 5427</span>&#160;        <span class="keyword">self</span>.headers = <span class="keyword">self</span>.element.find( options.header )</div>
<div class="line"><a name="l05428"></a><span class="lineno"> 5428</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-accordion-header ui-helper-reset ui-state-default ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l05429"></a><span class="lineno"> 5429</span>&#160;            .bind( <span class="stringliteral">&quot;mouseenter.accordion&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05430"></a><span class="lineno"> 5430</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l05431"></a><span class="lineno"> 5431</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05432"></a><span class="lineno"> 5432</span>&#160;                }</div>
<div class="line"><a name="l05433"></a><span class="lineno"> 5433</span>&#160;                $( this ).addClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> );</div>
<div class="line"><a name="l05434"></a><span class="lineno"> 5434</span>&#160;            })</div>
<div class="line"><a name="l05435"></a><span class="lineno"> 5435</span>&#160;            .bind( <span class="stringliteral">&quot;mouseleave.accordion&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05436"></a><span class="lineno"> 5436</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l05437"></a><span class="lineno"> 5437</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05438"></a><span class="lineno"> 5438</span>&#160;                }</div>
<div class="line"><a name="l05439"></a><span class="lineno"> 5439</span>&#160;                $( this ).removeClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> );</div>
<div class="line"><a name="l05440"></a><span class="lineno"> 5440</span>&#160;            })</div>
<div class="line"><a name="l05441"></a><span class="lineno"> 5441</span>&#160;            .bind( <span class="stringliteral">&quot;focus.accordion&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05442"></a><span class="lineno"> 5442</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l05443"></a><span class="lineno"> 5443</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05444"></a><span class="lineno"> 5444</span>&#160;                }</div>
<div class="line"><a name="l05445"></a><span class="lineno"> 5445</span>&#160;                $( this ).addClass( <span class="stringliteral">&quot;ui-state-focus&quot;</span> );</div>
<div class="line"><a name="l05446"></a><span class="lineno"> 5446</span>&#160;            })</div>
<div class="line"><a name="l05447"></a><span class="lineno"> 5447</span>&#160;            .bind( <span class="stringliteral">&quot;blur.accordion&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05448"></a><span class="lineno"> 5448</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l05449"></a><span class="lineno"> 5449</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05450"></a><span class="lineno"> 5450</span>&#160;                }</div>
<div class="line"><a name="l05451"></a><span class="lineno"> 5451</span>&#160;                $( this ).removeClass( <span class="stringliteral">&quot;ui-state-focus&quot;</span> );</div>
<div class="line"><a name="l05452"></a><span class="lineno"> 5452</span>&#160;            });</div>
<div class="line"><a name="l05453"></a><span class="lineno"> 5453</span>&#160;</div>
<div class="line"><a name="l05454"></a><span class="lineno"> 5454</span>&#160;        <span class="keyword">self</span>.headers.next()</div>
<div class="line"><a name="l05455"></a><span class="lineno"> 5455</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom&quot;</span> );</div>
<div class="line"><a name="l05456"></a><span class="lineno"> 5456</span>&#160;</div>
<div class="line"><a name="l05457"></a><span class="lineno"> 5457</span>&#160;        <span class="keywordflow">if</span> ( options.navigation ) {</div>
<div class="line"><a name="l05458"></a><span class="lineno"> 5458</span>&#160;            var current = <span class="keyword">self</span>.element.find( <span class="stringliteral">&quot;a&quot;</span> ).filter( options.navigationFilter ).eq( 0 );</div>
<div class="line"><a name="l05459"></a><span class="lineno"> 5459</span>&#160;            <span class="keywordflow">if</span> ( current.length ) {</div>
<div class="line"><a name="l05460"></a><span class="lineno"> 5460</span>&#160;                var header = current.closest( <span class="stringliteral">&quot;.ui-accordion-header&quot;</span> );</div>
<div class="line"><a name="l05461"></a><span class="lineno"> 5461</span>&#160;                <span class="keywordflow">if</span> ( header.length ) {</div>
<div class="line"><a name="l05462"></a><span class="lineno"> 5462</span>&#160;                    <span class="comment">// anchor within header</span></div>
<div class="line"><a name="l05463"></a><span class="lineno"> 5463</span>&#160;                    <span class="keyword">self</span>.active = header;</div>
<div class="line"><a name="l05464"></a><span class="lineno"> 5464</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05465"></a><span class="lineno"> 5465</span>&#160;                    <span class="comment">// anchor within content</span></div>
<div class="line"><a name="l05466"></a><span class="lineno"> 5466</span>&#160;                    <span class="keyword">self</span>.active = current.closest( <span class="stringliteral">&quot;.ui-accordion-content&quot;</span> ).prev();</div>
<div class="line"><a name="l05467"></a><span class="lineno"> 5467</span>&#160;                }</div>
<div class="line"><a name="l05468"></a><span class="lineno"> 5468</span>&#160;            }</div>
<div class="line"><a name="l05469"></a><span class="lineno"> 5469</span>&#160;        }</div>
<div class="line"><a name="l05470"></a><span class="lineno"> 5470</span>&#160;</div>
<div class="line"><a name="l05471"></a><span class="lineno"> 5471</span>&#160;        <span class="keyword">self</span>.active = <span class="keyword">self</span>._findActive( <span class="keyword">self</span>.active || options.active )</div>
<div class="line"><a name="l05472"></a><span class="lineno"> 5472</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-state-default ui-state-active&quot;</span> )</div>
<div class="line"><a name="l05473"></a><span class="lineno"> 5473</span>&#160;            .toggleClass( <span class="stringliteral">&quot;ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l05474"></a><span class="lineno"> 5474</span>&#160;            .toggleClass( <span class="stringliteral">&quot;ui-corner-top&quot;</span> );</div>
<div class="line"><a name="l05475"></a><span class="lineno"> 5475</span>&#160;        <span class="keyword">self</span>.active.next().addClass( <span class="stringliteral">&quot;ui-accordion-content-active&quot;</span> );</div>
<div class="line"><a name="l05476"></a><span class="lineno"> 5476</span>&#160;</div>
<div class="line"><a name="l05477"></a><span class="lineno"> 5477</span>&#160;        <span class="keyword">self</span>._createIcons();</div>
<div class="line"><a name="l05478"></a><span class="lineno"> 5478</span>&#160;        <span class="keyword">self</span>.resize();</div>
<div class="line"><a name="l05479"></a><span class="lineno"> 5479</span>&#160;        </div>
<div class="line"><a name="l05480"></a><span class="lineno"> 5480</span>&#160;        <span class="comment">// ARIA</span></div>
<div class="line"><a name="l05481"></a><span class="lineno"> 5481</span>&#160;        <span class="keyword">self</span>.element.attr( <span class="stringliteral">&quot;role&quot;</span>, <span class="stringliteral">&quot;tablist&quot;</span> );</div>
<div class="line"><a name="l05482"></a><span class="lineno"> 5482</span>&#160;</div>
<div class="line"><a name="l05483"></a><span class="lineno"> 5483</span>&#160;        <span class="keyword">self</span>.headers</div>
<div class="line"><a name="l05484"></a><span class="lineno"> 5484</span>&#160;            .attr( <span class="stringliteral">&quot;role&quot;</span>, <span class="stringliteral">&quot;tab&quot;</span> )</div>
<div class="line"><a name="l05485"></a><span class="lineno"> 5485</span>&#160;            .bind( <span class="stringliteral">&quot;keydown.accordion&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l05486"></a><span class="lineno"> 5486</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">self</span>._keydown( event );</div>
<div class="line"><a name="l05487"></a><span class="lineno"> 5487</span>&#160;            })</div>
<div class="line"><a name="l05488"></a><span class="lineno"> 5488</span>&#160;            .next()</div>
<div class="line"><a name="l05489"></a><span class="lineno"> 5489</span>&#160;                .attr( <span class="stringliteral">&quot;role&quot;</span>, <span class="stringliteral">&quot;tabpanel&quot;</span> );</div>
<div class="line"><a name="l05490"></a><span class="lineno"> 5490</span>&#160;</div>
<div class="line"><a name="l05491"></a><span class="lineno"> 5491</span>&#160;        <span class="keyword">self</span>.headers</div>
<div class="line"><a name="l05492"></a><span class="lineno"> 5492</span>&#160;            .not( <span class="keyword">self</span>.active || <span class="stringliteral">&quot;&quot;</span> )</div>
<div class="line"><a name="l05493"></a><span class="lineno"> 5493</span>&#160;            .attr({</div>
<div class="line"><a name="l05494"></a><span class="lineno"> 5494</span>&#160;                <span class="stringliteral">&quot;aria-expanded&quot;</span>: <span class="stringliteral">&quot;false&quot;</span>,</div>
<div class="line"><a name="l05495"></a><span class="lineno"> 5495</span>&#160;                <span class="stringliteral">&quot;aria-selected&quot;</span>: <span class="stringliteral">&quot;false&quot;</span>,</div>
<div class="line"><a name="l05496"></a><span class="lineno"> 5496</span>&#160;                tabIndex: -1</div>
<div class="line"><a name="l05497"></a><span class="lineno"> 5497</span>&#160;            })</div>
<div class="line"><a name="l05498"></a><span class="lineno"> 5498</span>&#160;            .next()</div>
<div class="line"><a name="l05499"></a><span class="lineno"> 5499</span>&#160;                .hide();</div>
<div class="line"><a name="l05500"></a><span class="lineno"> 5500</span>&#160;</div>
<div class="line"><a name="l05501"></a><span class="lineno"> 5501</span>&#160;        <span class="comment">// make sure at least one header is in the tab order</span></div>
<div class="line"><a name="l05502"></a><span class="lineno"> 5502</span>&#160;        <span class="keywordflow">if</span> ( !<span class="keyword">self</span>.active.length ) {</div>
<div class="line"><a name="l05503"></a><span class="lineno"> 5503</span>&#160;            <span class="keyword">self</span>.headers.eq( 0 ).attr( <span class="stringliteral">&quot;tabIndex&quot;</span>, 0 );</div>
<div class="line"><a name="l05504"></a><span class="lineno"> 5504</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05505"></a><span class="lineno"> 5505</span>&#160;            <span class="keyword">self</span>.active</div>
<div class="line"><a name="l05506"></a><span class="lineno"> 5506</span>&#160;                .attr({</div>
<div class="line"><a name="l05507"></a><span class="lineno"> 5507</span>&#160;                    <span class="stringliteral">&quot;aria-expanded&quot;</span>: <span class="stringliteral">&quot;true&quot;</span>,</div>
<div class="line"><a name="l05508"></a><span class="lineno"> 5508</span>&#160;                    <span class="stringliteral">&quot;aria-selected&quot;</span>: <span class="stringliteral">&quot;true&quot;</span>,</div>
<div class="line"><a name="l05509"></a><span class="lineno"> 5509</span>&#160;                    tabIndex: 0</div>
<div class="line"><a name="l05510"></a><span class="lineno"> 5510</span>&#160;                });</div>
<div class="line"><a name="l05511"></a><span class="lineno"> 5511</span>&#160;        }</div>
<div class="line"><a name="l05512"></a><span class="lineno"> 5512</span>&#160;</div>
<div class="line"><a name="l05513"></a><span class="lineno"> 5513</span>&#160;        <span class="comment">// only need links in tab order for Safari</span></div>
<div class="line"><a name="l05514"></a><span class="lineno"> 5514</span>&#160;        <span class="keywordflow">if</span> ( !$.browser.safari ) {</div>
<div class="line"><a name="l05515"></a><span class="lineno"> 5515</span>&#160;            <span class="keyword">self</span>.headers.find( <span class="stringliteral">&quot;a&quot;</span> ).attr( <span class="stringliteral">&quot;tabIndex&quot;</span>, -1 );</div>
<div class="line"><a name="l05516"></a><span class="lineno"> 5516</span>&#160;        }</div>
<div class="line"><a name="l05517"></a><span class="lineno"> 5517</span>&#160;</div>
<div class="line"><a name="l05518"></a><span class="lineno"> 5518</span>&#160;        <span class="keywordflow">if</span> ( options.event ) {</div>
<div class="line"><a name="l05519"></a><span class="lineno"> 5519</span>&#160;            <span class="keyword">self</span>.headers.bind( options.event.split(<span class="stringliteral">&quot; &quot;</span>).join(<span class="stringliteral">&quot;.accordion &quot;</span>) + <span class="stringliteral">&quot;.accordion&quot;</span>, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l05520"></a><span class="lineno"> 5520</span>&#160;                <span class="keyword">self</span>._clickHandler.call( <span class="keyword">self</span>, event, <span class="keyword">this</span> );</div>
<div class="line"><a name="l05521"></a><span class="lineno"> 5521</span>&#160;                <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l05522"></a><span class="lineno"> 5522</span>&#160;            });</div>
<div class="line"><a name="l05523"></a><span class="lineno"> 5523</span>&#160;        }</div>
<div class="line"><a name="l05524"></a><span class="lineno"> 5524</span>&#160;    },</div>
<div class="line"><a name="l05525"></a><span class="lineno"> 5525</span>&#160;</div>
<div class="line"><a name="l05526"></a><span class="lineno"> 5526</span>&#160;    _createIcons: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05527"></a><span class="lineno"> 5527</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l05528"></a><span class="lineno"> 5528</span>&#160;        <span class="keywordflow">if</span> ( options.icons ) {</div>
<div class="line"><a name="l05529"></a><span class="lineno"> 5529</span>&#160;            $( <span class="stringliteral">&quot;&lt;span&gt;&lt;/span&gt;&quot;</span> )</div>
<div class="line"><a name="l05530"></a><span class="lineno"> 5530</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-icon &quot;</span> + options.icons.header )</div>
<div class="line"><a name="l05531"></a><span class="lineno"> 5531</span>&#160;                .prependTo( this.headers );</div>
<div class="line"><a name="l05532"></a><span class="lineno"> 5532</span>&#160;            this.active.children( <span class="stringliteral">&quot;.ui-icon&quot;</span> )</div>
<div class="line"><a name="l05533"></a><span class="lineno"> 5533</span>&#160;                .toggleClass(options.icons.header)</div>
<div class="line"><a name="l05534"></a><span class="lineno"> 5534</span>&#160;                .toggleClass(options.icons.headerSelected);</div>
<div class="line"><a name="l05535"></a><span class="lineno"> 5535</span>&#160;            this.element.addClass( <span class="stringliteral">&quot;ui-accordion-icons&quot;</span> );</div>
<div class="line"><a name="l05536"></a><span class="lineno"> 5536</span>&#160;        }</div>
<div class="line"><a name="l05537"></a><span class="lineno"> 5537</span>&#160;    },</div>
<div class="line"><a name="l05538"></a><span class="lineno"> 5538</span>&#160;</div>
<div class="line"><a name="l05539"></a><span class="lineno"> 5539</span>&#160;    _destroyIcons: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05540"></a><span class="lineno"> 5540</span>&#160;        this.headers.children( <span class="stringliteral">&quot;.ui-icon&quot;</span> ).remove();</div>
<div class="line"><a name="l05541"></a><span class="lineno"> 5541</span>&#160;        this.element.removeClass( <span class="stringliteral">&quot;ui-accordion-icons&quot;</span> );</div>
<div class="line"><a name="l05542"></a><span class="lineno"> 5542</span>&#160;    },</div>
<div class="line"><a name="l05543"></a><span class="lineno"> 5543</span>&#160;</div>
<div class="line"><a name="l05544"></a><span class="lineno"> 5544</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05545"></a><span class="lineno"> 5545</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l05546"></a><span class="lineno"> 5546</span>&#160;</div>
<div class="line"><a name="l05547"></a><span class="lineno"> 5547</span>&#160;        this.element</div>
<div class="line"><a name="l05548"></a><span class="lineno"> 5548</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-accordion ui-widget ui-helper-reset&quot;</span> )</div>
<div class="line"><a name="l05549"></a><span class="lineno"> 5549</span>&#160;            .removeAttr( <span class="stringliteral">&quot;role&quot;</span> );</div>
<div class="line"><a name="l05550"></a><span class="lineno"> 5550</span>&#160;</div>
<div class="line"><a name="l05551"></a><span class="lineno"> 5551</span>&#160;        this.headers</div>
<div class="line"><a name="l05552"></a><span class="lineno"> 5552</span>&#160;            .unbind( <span class="stringliteral">&quot;.accordion&quot;</span> )</div>
<div class="line"><a name="l05553"></a><span class="lineno"> 5553</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top&quot;</span> )</div>
<div class="line"><a name="l05554"></a><span class="lineno"> 5554</span>&#160;            .removeAttr( <span class="stringliteral">&quot;role&quot;</span> )</div>
<div class="line"><a name="l05555"></a><span class="lineno"> 5555</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-expanded&quot;</span> )</div>
<div class="line"><a name="l05556"></a><span class="lineno"> 5556</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-selected&quot;</span> )</div>
<div class="line"><a name="l05557"></a><span class="lineno"> 5557</span>&#160;            .removeAttr( <span class="stringliteral">&quot;tabIndex&quot;</span> );</div>
<div class="line"><a name="l05558"></a><span class="lineno"> 5558</span>&#160;</div>
<div class="line"><a name="l05559"></a><span class="lineno"> 5559</span>&#160;        this.headers.find( <span class="stringliteral">&quot;a&quot;</span> ).removeAttr( <span class="stringliteral">&quot;tabIndex&quot;</span> );</div>
<div class="line"><a name="l05560"></a><span class="lineno"> 5560</span>&#160;        this._destroyIcons();</div>
<div class="line"><a name="l05561"></a><span class="lineno"> 5561</span>&#160;        var contents = this.headers.next()</div>
<div class="line"><a name="l05562"></a><span class="lineno"> 5562</span>&#160;            .css( <span class="stringliteral">&quot;display&quot;</span>, <span class="stringliteral">&quot;&quot;</span> )</div>
<div class="line"><a name="l05563"></a><span class="lineno"> 5563</span>&#160;            .removeAttr( <span class="stringliteral">&quot;role&quot;</span> )</div>
<div class="line"><a name="l05564"></a><span class="lineno"> 5564</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled&quot;</span> );</div>
<div class="line"><a name="l05565"></a><span class="lineno"> 5565</span>&#160;        <span class="keywordflow">if</span> ( options.autoHeight || options.fillHeight ) {</div>
<div class="line"><a name="l05566"></a><span class="lineno"> 5566</span>&#160;            contents.css( <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;&quot;</span> );</div>
<div class="line"><a name="l05567"></a><span class="lineno"> 5567</span>&#160;        }</div>
<div class="line"><a name="l05568"></a><span class="lineno"> 5568</span>&#160;</div>
<div class="line"><a name="l05569"></a><span class="lineno"> 5569</span>&#160;        <span class="keywordflow">return</span> $.Widget.prototype.destroy.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l05570"></a><span class="lineno"> 5570</span>&#160;    },</div>
<div class="line"><a name="l05571"></a><span class="lineno"> 5571</span>&#160;</div>
<div class="line"><a name="l05572"></a><span class="lineno"> 5572</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l05573"></a><span class="lineno"> 5573</span>&#160;        $.Widget.prototype._setOption.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l05574"></a><span class="lineno"> 5574</span>&#160;            </div>
<div class="line"><a name="l05575"></a><span class="lineno"> 5575</span>&#160;        <span class="keywordflow">if</span> ( key == <span class="stringliteral">&quot;active&quot;</span> ) {</div>
<div class="line"><a name="l05576"></a><span class="lineno"> 5576</span>&#160;            this.activate( value );</div>
<div class="line"><a name="l05577"></a><span class="lineno"> 5577</span>&#160;        }</div>
<div class="line"><a name="l05578"></a><span class="lineno"> 5578</span>&#160;        <span class="keywordflow">if</span> ( key == <span class="stringliteral">&quot;icons&quot;</span> ) {</div>
<div class="line"><a name="l05579"></a><span class="lineno"> 5579</span>&#160;            this._destroyIcons();</div>
<div class="line"><a name="l05580"></a><span class="lineno"> 5580</span>&#160;            <span class="keywordflow">if</span> ( value ) {</div>
<div class="line"><a name="l05581"></a><span class="lineno"> 5581</span>&#160;                this._createIcons();</div>
<div class="line"><a name="l05582"></a><span class="lineno"> 5582</span>&#160;            }</div>
<div class="line"><a name="l05583"></a><span class="lineno"> 5583</span>&#160;        }</div>
<div class="line"><a name="l05584"></a><span class="lineno"> 5584</span>&#160;        <span class="comment">// #5332 - opacity doesn&#39;t cascade to positioned elements in IE</span></div>
<div class="line"><a name="l05585"></a><span class="lineno"> 5585</span>&#160;        <span class="comment">// so we need to add the disabled class to the headers and panels</span></div>
<div class="line"><a name="l05586"></a><span class="lineno"> 5586</span>&#160;        <span class="keywordflow">if</span> ( key == <span class="stringliteral">&quot;disabled&quot;</span> ) {</div>
<div class="line"><a name="l05587"></a><span class="lineno"> 5587</span>&#160;            this.headers.add(this.headers.next())</div>
<div class="line"><a name="l05588"></a><span class="lineno"> 5588</span>&#160;                [ value ? <span class="stringliteral">&quot;addClass&quot;</span> : <span class="stringliteral">&quot;removeClass&quot;</span> ](</div>
<div class="line"><a name="l05589"></a><span class="lineno"> 5589</span>&#160;                    <span class="stringliteral">&quot;ui-accordion-disabled ui-state-disabled&quot;</span> );</div>
<div class="line"><a name="l05590"></a><span class="lineno"> 5590</span>&#160;        }</div>
<div class="line"><a name="l05591"></a><span class="lineno"> 5591</span>&#160;    },</div>
<div class="line"><a name="l05592"></a><span class="lineno"> 5592</span>&#160;</div>
<div class="line"><a name="l05593"></a><span class="lineno"> 5593</span>&#160;    _keydown: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l05594"></a><span class="lineno"> 5594</span>&#160;        <span class="keywordflow">if</span> ( this.options.disabled || event.altKey || event.ctrlKey ) {</div>
<div class="line"><a name="l05595"></a><span class="lineno"> 5595</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05596"></a><span class="lineno"> 5596</span>&#160;        }</div>
<div class="line"><a name="l05597"></a><span class="lineno"> 5597</span>&#160;</div>
<div class="line"><a name="l05598"></a><span class="lineno"> 5598</span>&#160;        var keyCode = $.ui.keyCode,</div>
<div class="line"><a name="l05599"></a><span class="lineno"> 5599</span>&#160;            length = this.headers.length,</div>
<div class="line"><a name="l05600"></a><span class="lineno"> 5600</span>&#160;            currentIndex = this.headers.index( event.target ),</div>
<div class="line"><a name="l05601"></a><span class="lineno"> 5601</span>&#160;            toFocus = <span class="keyword">false</span>;</div>
<div class="line"><a name="l05602"></a><span class="lineno"> 5602</span>&#160;</div>
<div class="line"><a name="l05603"></a><span class="lineno"> 5603</span>&#160;        <span class="keywordflow">switch</span> ( event.keyCode ) {</div>
<div class="line"><a name="l05604"></a><span class="lineno"> 5604</span>&#160;            <span class="keywordflow">case</span> keyCode.RIGHT:</div>
<div class="line"><a name="l05605"></a><span class="lineno"> 5605</span>&#160;            <span class="keywordflow">case</span> keyCode.DOWN:</div>
<div class="line"><a name="l05606"></a><span class="lineno"> 5606</span>&#160;                toFocus = this.headers[ ( currentIndex + 1 ) % length ];</div>
<div class="line"><a name="l05607"></a><span class="lineno"> 5607</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05608"></a><span class="lineno"> 5608</span>&#160;            <span class="keywordflow">case</span> keyCode.LEFT:</div>
<div class="line"><a name="l05609"></a><span class="lineno"> 5609</span>&#160;            <span class="keywordflow">case</span> keyCode.UP:</div>
<div class="line"><a name="l05610"></a><span class="lineno"> 5610</span>&#160;                toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];</div>
<div class="line"><a name="l05611"></a><span class="lineno"> 5611</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l05612"></a><span class="lineno"> 5612</span>&#160;            <span class="keywordflow">case</span> keyCode.SPACE:</div>
<div class="line"><a name="l05613"></a><span class="lineno"> 5613</span>&#160;            <span class="keywordflow">case</span> keyCode.ENTER:</div>
<div class="line"><a name="l05614"></a><span class="lineno"> 5614</span>&#160;                this._clickHandler( { target: <span class="keyword">event</span>.target }, <span class="keyword">event</span>.target );</div>
<div class="line"><a name="l05615"></a><span class="lineno"> 5615</span>&#160;                <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l05616"></a><span class="lineno"> 5616</span>&#160;        }</div>
<div class="line"><a name="l05617"></a><span class="lineno"> 5617</span>&#160;</div>
<div class="line"><a name="l05618"></a><span class="lineno"> 5618</span>&#160;        <span class="keywordflow">if</span> ( toFocus ) {</div>
<div class="line"><a name="l05619"></a><span class="lineno"> 5619</span>&#160;            $( <span class="keyword">event</span>.target ).attr( <span class="stringliteral">&quot;tabIndex&quot;</span>, -1 );</div>
<div class="line"><a name="l05620"></a><span class="lineno"> 5620</span>&#160;            $( toFocus ).attr( <span class="stringliteral">&quot;tabIndex&quot;</span>, 0 );</div>
<div class="line"><a name="l05621"></a><span class="lineno"> 5621</span>&#160;            toFocus.focus();</div>
<div class="line"><a name="l05622"></a><span class="lineno"> 5622</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l05623"></a><span class="lineno"> 5623</span>&#160;        }</div>
<div class="line"><a name="l05624"></a><span class="lineno"> 5624</span>&#160;</div>
<div class="line"><a name="l05625"></a><span class="lineno"> 5625</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l05626"></a><span class="lineno"> 5626</span>&#160;    },</div>
<div class="line"><a name="l05627"></a><span class="lineno"> 5627</span>&#160;</div>
<div class="line"><a name="l05628"></a><span class="lineno"> 5628</span>&#160;    resize: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05629"></a><span class="lineno"> 5629</span>&#160;        var options = this.options,</div>
<div class="line"><a name="l05630"></a><span class="lineno"> 5630</span>&#160;            maxHeight;</div>
<div class="line"><a name="l05631"></a><span class="lineno"> 5631</span>&#160;</div>
<div class="line"><a name="l05632"></a><span class="lineno"> 5632</span>&#160;        <span class="keywordflow">if</span> ( options.fillSpace ) {</div>
<div class="line"><a name="l05633"></a><span class="lineno"> 5633</span>&#160;            <span class="keywordflow">if</span> ( $.browser.msie ) {</div>
<div class="line"><a name="l05634"></a><span class="lineno"> 5634</span>&#160;                var defOverflow = this.element.parent().css( <span class="stringliteral">&quot;overflow&quot;</span> );</div>
<div class="line"><a name="l05635"></a><span class="lineno"> 5635</span>&#160;                this.element.parent().css( <span class="stringliteral">&quot;overflow&quot;</span>, <span class="stringliteral">&quot;hidden&quot;</span>);</div>
<div class="line"><a name="l05636"></a><span class="lineno"> 5636</span>&#160;            }</div>
<div class="line"><a name="l05637"></a><span class="lineno"> 5637</span>&#160;            maxHeight = this.element.parent().height();</div>
<div class="line"><a name="l05638"></a><span class="lineno"> 5638</span>&#160;            <span class="keywordflow">if</span> ($.browser.msie) {</div>
<div class="line"><a name="l05639"></a><span class="lineno"> 5639</span>&#160;                this.element.parent().css( <span class="stringliteral">&quot;overflow&quot;</span>, defOverflow );</div>
<div class="line"><a name="l05640"></a><span class="lineno"> 5640</span>&#160;            }</div>
<div class="line"><a name="l05641"></a><span class="lineno"> 5641</span>&#160;</div>
<div class="line"><a name="l05642"></a><span class="lineno"> 5642</span>&#160;            this.headers.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05643"></a><span class="lineno"> 5643</span>&#160;                maxHeight -= $( this ).outerHeight( <span class="keyword">true</span> );</div>
<div class="line"><a name="l05644"></a><span class="lineno"> 5644</span>&#160;            });</div>
<div class="line"><a name="l05645"></a><span class="lineno"> 5645</span>&#160;</div>
<div class="line"><a name="l05646"></a><span class="lineno"> 5646</span>&#160;            this.headers.next()</div>
<div class="line"><a name="l05647"></a><span class="lineno"> 5647</span>&#160;                .each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05648"></a><span class="lineno"> 5648</span>&#160;                    $( this ).height( Math.max( 0, maxHeight -</div>
<div class="line"><a name="l05649"></a><span class="lineno"> 5649</span>&#160;                        $( <span class="keyword">this</span> ).innerHeight() + $( this ).height() ) );</div>
<div class="line"><a name="l05650"></a><span class="lineno"> 5650</span>&#160;                })</div>
<div class="line"><a name="l05651"></a><span class="lineno"> 5651</span>&#160;                .css( <span class="stringliteral">&quot;overflow&quot;</span>, <span class="stringliteral">&quot;auto&quot;</span> );</div>
<div class="line"><a name="l05652"></a><span class="lineno"> 5652</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( options.autoHeight ) {</div>
<div class="line"><a name="l05653"></a><span class="lineno"> 5653</span>&#160;            maxHeight = 0;</div>
<div class="line"><a name="l05654"></a><span class="lineno"> 5654</span>&#160;            this.headers.next()</div>
<div class="line"><a name="l05655"></a><span class="lineno"> 5655</span>&#160;                .each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l05656"></a><span class="lineno"> 5656</span>&#160;                    maxHeight = Math.max( maxHeight, $( <span class="keyword">this</span> ).height( <span class="stringliteral">&quot;&quot;</span> ).height() );</div>
<div class="line"><a name="l05657"></a><span class="lineno"> 5657</span>&#160;                })</div>
<div class="line"><a name="l05658"></a><span class="lineno"> 5658</span>&#160;                .height( maxHeight );</div>
<div class="line"><a name="l05659"></a><span class="lineno"> 5659</span>&#160;        }</div>
<div class="line"><a name="l05660"></a><span class="lineno"> 5660</span>&#160;</div>
<div class="line"><a name="l05661"></a><span class="lineno"> 5661</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l05662"></a><span class="lineno"> 5662</span>&#160;    },</div>
<div class="line"><a name="l05663"></a><span class="lineno"> 5663</span>&#160;</div>
<div class="line"><a name="l05664"></a><span class="lineno"> 5664</span>&#160;    activate: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l05665"></a><span class="lineno"> 5665</span>&#160;        <span class="comment">// TODO this gets called on init, changing the option without an explicit call for that</span></div>
<div class="line"><a name="l05666"></a><span class="lineno"> 5666</span>&#160;        this.options.active = index;</div>
<div class="line"><a name="l05667"></a><span class="lineno"> 5667</span>&#160;        <span class="comment">// call clickHandler with custom event</span></div>
<div class="line"><a name="l05668"></a><span class="lineno"> 5668</span>&#160;        var active = this._findActive( index )[ 0 ];</div>
<div class="line"><a name="l05669"></a><span class="lineno"> 5669</span>&#160;        this._clickHandler( { target: active }, active );</div>
<div class="line"><a name="l05670"></a><span class="lineno"> 5670</span>&#160;</div>
<div class="line"><a name="l05671"></a><span class="lineno"> 5671</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l05672"></a><span class="lineno"> 5672</span>&#160;    },</div>
<div class="line"><a name="l05673"></a><span class="lineno"> 5673</span>&#160;</div>
<div class="line"><a name="l05674"></a><span class="lineno"> 5674</span>&#160;    _findActive: <span class="keyword">function</span>( selector ) {</div>
<div class="line"><a name="l05675"></a><span class="lineno"> 5675</span>&#160;        <span class="keywordflow">return</span> selector</div>
<div class="line"><a name="l05676"></a><span class="lineno"> 5676</span>&#160;            ? typeof selector === <span class="stringliteral">&quot;number&quot;</span></div>
<div class="line"><a name="l05677"></a><span class="lineno"> 5677</span>&#160;                ? this.headers.filter( <span class="stringliteral">&quot;:eq(&quot;</span> + selector + <span class="stringliteral">&quot;)&quot;</span> )</div>
<div class="line"><a name="l05678"></a><span class="lineno"> 5678</span>&#160;                : this.headers.not( this.headers.not( selector ) )</div>
<div class="line"><a name="l05679"></a><span class="lineno"> 5679</span>&#160;            : selector === <span class="keyword">false</span></div>
<div class="line"><a name="l05680"></a><span class="lineno"> 5680</span>&#160;                ? $( [] )</div>
<div class="line"><a name="l05681"></a><span class="lineno"> 5681</span>&#160;                : this.headers.filter( <span class="stringliteral">&quot;:eq(0)&quot;</span> );</div>
<div class="line"><a name="l05682"></a><span class="lineno"> 5682</span>&#160;    },</div>
<div class="line"><a name="l05683"></a><span class="lineno"> 5683</span>&#160;</div>
<div class="line"><a name="l05684"></a><span class="lineno"> 5684</span>&#160;    <span class="comment">// TODO isn&#39;t event.target enough? why the separate target argument?</span></div>
<div class="line"><a name="l05685"></a><span class="lineno"> 5685</span>&#160;    _clickHandler: <span class="keyword">function</span>( event, target ) {</div>
<div class="line"><a name="l05686"></a><span class="lineno"> 5686</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l05687"></a><span class="lineno"> 5687</span>&#160;        <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l05688"></a><span class="lineno"> 5688</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05689"></a><span class="lineno"> 5689</span>&#160;        }</div>
<div class="line"><a name="l05690"></a><span class="lineno"> 5690</span>&#160;</div>
<div class="line"><a name="l05691"></a><span class="lineno"> 5691</span>&#160;        <span class="comment">// called only when using activate(false) to close all parts programmatically</span></div>
<div class="line"><a name="l05692"></a><span class="lineno"> 5692</span>&#160;        <span class="keywordflow">if</span> ( !event.target ) {</div>
<div class="line"><a name="l05693"></a><span class="lineno"> 5693</span>&#160;            <span class="keywordflow">if</span> ( !options.collapsible ) {</div>
<div class="line"><a name="l05694"></a><span class="lineno"> 5694</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05695"></a><span class="lineno"> 5695</span>&#160;            }</div>
<div class="line"><a name="l05696"></a><span class="lineno"> 5696</span>&#160;            this.active</div>
<div class="line"><a name="l05697"></a><span class="lineno"> 5697</span>&#160;                .removeClass( <span class="stringliteral">&quot;ui-state-active ui-corner-top&quot;</span> )</div>
<div class="line"><a name="l05698"></a><span class="lineno"> 5698</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-state-default ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l05699"></a><span class="lineno"> 5699</span>&#160;                .children( <span class="stringliteral">&quot;.ui-icon&quot;</span> )</div>
<div class="line"><a name="l05700"></a><span class="lineno"> 5700</span>&#160;                    .removeClass( options.icons.headerSelected )</div>
<div class="line"><a name="l05701"></a><span class="lineno"> 5701</span>&#160;                    .addClass( options.icons.header );</div>
<div class="line"><a name="l05702"></a><span class="lineno"> 5702</span>&#160;            this.active.next().addClass( <span class="stringliteral">&quot;ui-accordion-content-active&quot;</span> );</div>
<div class="line"><a name="l05703"></a><span class="lineno"> 5703</span>&#160;            var toHide = this.active.next(),</div>
<div class="line"><a name="l05704"></a><span class="lineno"> 5704</span>&#160;                data = {</div>
<div class="line"><a name="l05705"></a><span class="lineno"> 5705</span>&#160;                    options: options,</div>
<div class="line"><a name="l05706"></a><span class="lineno"> 5706</span>&#160;                    newHeader: $( [] ),</div>
<div class="line"><a name="l05707"></a><span class="lineno"> 5707</span>&#160;                    oldHeader: options.active,</div>
<div class="line"><a name="l05708"></a><span class="lineno"> 5708</span>&#160;                    newContent: $( [] ),</div>
<div class="line"><a name="l05709"></a><span class="lineno"> 5709</span>&#160;                    oldContent: toHide</div>
<div class="line"><a name="l05710"></a><span class="lineno"> 5710</span>&#160;                },</div>
<div class="line"><a name="l05711"></a><span class="lineno"> 5711</span>&#160;                toShow = ( this.active = $( [] ) );</div>
<div class="line"><a name="l05712"></a><span class="lineno"> 5712</span>&#160;            this._toggle( toShow, toHide, data );</div>
<div class="line"><a name="l05713"></a><span class="lineno"> 5713</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05714"></a><span class="lineno"> 5714</span>&#160;        }</div>
<div class="line"><a name="l05715"></a><span class="lineno"> 5715</span>&#160;</div>
<div class="line"><a name="l05716"></a><span class="lineno"> 5716</span>&#160;        <span class="comment">// get the click target</span></div>
<div class="line"><a name="l05717"></a><span class="lineno"> 5717</span>&#160;        var clicked = $( <span class="keyword">event</span>.currentTarget || target ),</div>
<div class="line"><a name="l05718"></a><span class="lineno"> 5718</span>&#160;            clickedIsActive = clicked[0] === this.active[0];</div>
<div class="line"><a name="l05719"></a><span class="lineno"> 5719</span>&#160;</div>
<div class="line"><a name="l05720"></a><span class="lineno"> 5720</span>&#160;        <span class="comment">// TODO the option is changed, is that correct?</span></div>
<div class="line"><a name="l05721"></a><span class="lineno"> 5721</span>&#160;        <span class="comment">// TODO if it is correct, shouldn&#39;t that happen after determining that the click is valid?</span></div>
<div class="line"><a name="l05722"></a><span class="lineno"> 5722</span>&#160;        options.active = options.collapsible &amp;&amp; clickedIsActive ?</div>
<div class="line"><a name="l05723"></a><span class="lineno"> 5723</span>&#160;            <span class="keyword">false</span> :</div>
<div class="line"><a name="l05724"></a><span class="lineno"> 5724</span>&#160;            this.headers.index( clicked );</div>
<div class="line"><a name="l05725"></a><span class="lineno"> 5725</span>&#160;</div>
<div class="line"><a name="l05726"></a><span class="lineno"> 5726</span>&#160;        <span class="comment">// if animations are still active, or the active header is the target, ignore click</span></div>
<div class="line"><a name="l05727"></a><span class="lineno"> 5727</span>&#160;        <span class="keywordflow">if</span> ( this.running || ( !options.collapsible &amp;&amp; clickedIsActive ) ) {</div>
<div class="line"><a name="l05728"></a><span class="lineno"> 5728</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05729"></a><span class="lineno"> 5729</span>&#160;        }</div>
<div class="line"><a name="l05730"></a><span class="lineno"> 5730</span>&#160;</div>
<div class="line"><a name="l05731"></a><span class="lineno"> 5731</span>&#160;        <span class="comment">// find elements to show and hide</span></div>
<div class="line"><a name="l05732"></a><span class="lineno"> 5732</span>&#160;        var active = this.active,</div>
<div class="line"><a name="l05733"></a><span class="lineno"> 5733</span>&#160;            toShow = clicked.next(),</div>
<div class="line"><a name="l05734"></a><span class="lineno"> 5734</span>&#160;            toHide = this.active.next(),</div>
<div class="line"><a name="l05735"></a><span class="lineno"> 5735</span>&#160;            data = {</div>
<div class="line"><a name="l05736"></a><span class="lineno"> 5736</span>&#160;                options: options,</div>
<div class="line"><a name="l05737"></a><span class="lineno"> 5737</span>&#160;                newHeader: clickedIsActive &amp;&amp; options.collapsible ? $([]) : clicked,</div>
<div class="line"><a name="l05738"></a><span class="lineno"> 5738</span>&#160;                oldHeader: this.active,</div>
<div class="line"><a name="l05739"></a><span class="lineno"> 5739</span>&#160;                newContent: clickedIsActive &amp;&amp; options.collapsible ? $([]) : toShow,</div>
<div class="line"><a name="l05740"></a><span class="lineno"> 5740</span>&#160;                oldContent: toHide</div>
<div class="line"><a name="l05741"></a><span class="lineno"> 5741</span>&#160;            },</div>
<div class="line"><a name="l05742"></a><span class="lineno"> 5742</span>&#160;            down = this.headers.index( this.active[0] ) &gt; this.headers.index( clicked[0] );</div>
<div class="line"><a name="l05743"></a><span class="lineno"> 5743</span>&#160;</div>
<div class="line"><a name="l05744"></a><span class="lineno"> 5744</span>&#160;        <span class="comment">// when the call to ._toggle() comes after the class changes</span></div>
<div class="line"><a name="l05745"></a><span class="lineno"> 5745</span>&#160;        <span class="comment">// it causes a very odd bug in IE 8 (see #6720)</span></div>
<div class="line"><a name="l05746"></a><span class="lineno"> 5746</span>&#160;        this.active = clickedIsActive ? $([]) : clicked;</div>
<div class="line"><a name="l05747"></a><span class="lineno"> 5747</span>&#160;        this._toggle( toShow, toHide, data, clickedIsActive, down );</div>
<div class="line"><a name="l05748"></a><span class="lineno"> 5748</span>&#160;</div>
<div class="line"><a name="l05749"></a><span class="lineno"> 5749</span>&#160;        <span class="comment">// switch classes</span></div>
<div class="line"><a name="l05750"></a><span class="lineno"> 5750</span>&#160;        active</div>
<div class="line"><a name="l05751"></a><span class="lineno"> 5751</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-state-active ui-corner-top&quot;</span> )</div>
<div class="line"><a name="l05752"></a><span class="lineno"> 5752</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-state-default ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l05753"></a><span class="lineno"> 5753</span>&#160;            .children( <span class="stringliteral">&quot;.ui-icon&quot;</span> )</div>
<div class="line"><a name="l05754"></a><span class="lineno"> 5754</span>&#160;                .removeClass( options.icons.headerSelected )</div>
<div class="line"><a name="l05755"></a><span class="lineno"> 5755</span>&#160;                .addClass( options.icons.header );</div>
<div class="line"><a name="l05756"></a><span class="lineno"> 5756</span>&#160;        <span class="keywordflow">if</span> ( !clickedIsActive ) {</div>
<div class="line"><a name="l05757"></a><span class="lineno"> 5757</span>&#160;            clicked</div>
<div class="line"><a name="l05758"></a><span class="lineno"> 5758</span>&#160;                .removeClass( <span class="stringliteral">&quot;ui-state-default ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l05759"></a><span class="lineno"> 5759</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-state-active ui-corner-top&quot;</span> )</div>
<div class="line"><a name="l05760"></a><span class="lineno"> 5760</span>&#160;                .children( <span class="stringliteral">&quot;.ui-icon&quot;</span> )</div>
<div class="line"><a name="l05761"></a><span class="lineno"> 5761</span>&#160;                    .removeClass( options.icons.header )</div>
<div class="line"><a name="l05762"></a><span class="lineno"> 5762</span>&#160;                    .addClass( options.icons.headerSelected );</div>
<div class="line"><a name="l05763"></a><span class="lineno"> 5763</span>&#160;            clicked</div>
<div class="line"><a name="l05764"></a><span class="lineno"> 5764</span>&#160;                .next()</div>
<div class="line"><a name="l05765"></a><span class="lineno"> 5765</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-accordion-content-active&quot;</span> );</div>
<div class="line"><a name="l05766"></a><span class="lineno"> 5766</span>&#160;        }</div>
<div class="line"><a name="l05767"></a><span class="lineno"> 5767</span>&#160;</div>
<div class="line"><a name="l05768"></a><span class="lineno"> 5768</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05769"></a><span class="lineno"> 5769</span>&#160;    },</div>
<div class="line"><a name="l05770"></a><span class="lineno"> 5770</span>&#160;</div>
<div class="line"><a name="l05771"></a><span class="lineno"> 5771</span>&#160;    _toggle: <span class="keyword">function</span>( toShow, toHide, data, clickedIsActive, down ) {</div>
<div class="line"><a name="l05772"></a><span class="lineno"> 5772</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l05773"></a><span class="lineno"> 5773</span>&#160;            options = <span class="keyword">self</span>.options;</div>
<div class="line"><a name="l05774"></a><span class="lineno"> 5774</span>&#160;</div>
<div class="line"><a name="l05775"></a><span class="lineno"> 5775</span>&#160;        <span class="keyword">self</span>.toShow = toShow;</div>
<div class="line"><a name="l05776"></a><span class="lineno"> 5776</span>&#160;        <span class="keyword">self</span>.toHide = toHide;</div>
<div class="line"><a name="l05777"></a><span class="lineno"> 5777</span>&#160;        <span class="keyword">self</span>.data = data;</div>
<div class="line"><a name="l05778"></a><span class="lineno"> 5778</span>&#160;</div>
<div class="line"><a name="l05779"></a><span class="lineno"> 5779</span>&#160;        var complete = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05780"></a><span class="lineno"> 5780</span>&#160;            <span class="keywordflow">if</span> ( !<span class="keyword">self</span> ) {</div>
<div class="line"><a name="l05781"></a><span class="lineno"> 5781</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05782"></a><span class="lineno"> 5782</span>&#160;            }</div>
<div class="line"><a name="l05783"></a><span class="lineno"> 5783</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">self</span>._completed.apply( <span class="keyword">self</span>, arguments );</div>
<div class="line"><a name="l05784"></a><span class="lineno"> 5784</span>&#160;        };</div>
<div class="line"><a name="l05785"></a><span class="lineno"> 5785</span>&#160;</div>
<div class="line"><a name="l05786"></a><span class="lineno"> 5786</span>&#160;        <span class="comment">// trigger changestart event</span></div>
<div class="line"><a name="l05787"></a><span class="lineno"> 5787</span>&#160;        <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;changestart&quot;</span>, null, <span class="keyword">self</span>.data );</div>
<div class="line"><a name="l05788"></a><span class="lineno"> 5788</span>&#160;</div>
<div class="line"><a name="l05789"></a><span class="lineno"> 5789</span>&#160;        <span class="comment">// count elements to animate</span></div>
<div class="line"><a name="l05790"></a><span class="lineno"> 5790</span>&#160;        <span class="keyword">self</span>.running = toHide.size() === 0 ? toShow.size() : toHide.size();</div>
<div class="line"><a name="l05791"></a><span class="lineno"> 5791</span>&#160;</div>
<div class="line"><a name="l05792"></a><span class="lineno"> 5792</span>&#160;        <span class="keywordflow">if</span> ( options.animated ) {</div>
<div class="line"><a name="l05793"></a><span class="lineno"> 5793</span>&#160;            var animOptions = {};</div>
<div class="line"><a name="l05794"></a><span class="lineno"> 5794</span>&#160;</div>
<div class="line"><a name="l05795"></a><span class="lineno"> 5795</span>&#160;            <span class="keywordflow">if</span> ( options.collapsible &amp;&amp; clickedIsActive ) {</div>
<div class="line"><a name="l05796"></a><span class="lineno"> 5796</span>&#160;                animOptions = {</div>
<div class="line"><a name="l05797"></a><span class="lineno"> 5797</span>&#160;                    toShow: $( [] ),</div>
<div class="line"><a name="l05798"></a><span class="lineno"> 5798</span>&#160;                    toHide: toHide,</div>
<div class="line"><a name="l05799"></a><span class="lineno"> 5799</span>&#160;                    complete: complete,</div>
<div class="line"><a name="l05800"></a><span class="lineno"> 5800</span>&#160;                    down: down,</div>
<div class="line"><a name="l05801"></a><span class="lineno"> 5801</span>&#160;                    autoHeight: options.autoHeight || options.fillSpace</div>
<div class="line"><a name="l05802"></a><span class="lineno"> 5802</span>&#160;                };</div>
<div class="line"><a name="l05803"></a><span class="lineno"> 5803</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05804"></a><span class="lineno"> 5804</span>&#160;                animOptions = {</div>
<div class="line"><a name="l05805"></a><span class="lineno"> 5805</span>&#160;                    toShow: toShow,</div>
<div class="line"><a name="l05806"></a><span class="lineno"> 5806</span>&#160;                    toHide: toHide,</div>
<div class="line"><a name="l05807"></a><span class="lineno"> 5807</span>&#160;                    complete: complete,</div>
<div class="line"><a name="l05808"></a><span class="lineno"> 5808</span>&#160;                    down: down,</div>
<div class="line"><a name="l05809"></a><span class="lineno"> 5809</span>&#160;                    autoHeight: options.autoHeight || options.fillSpace</div>
<div class="line"><a name="l05810"></a><span class="lineno"> 5810</span>&#160;                };</div>
<div class="line"><a name="l05811"></a><span class="lineno"> 5811</span>&#160;            }</div>
<div class="line"><a name="l05812"></a><span class="lineno"> 5812</span>&#160;</div>
<div class="line"><a name="l05813"></a><span class="lineno"> 5813</span>&#160;            <span class="keywordflow">if</span> ( !options.proxied ) {</div>
<div class="line"><a name="l05814"></a><span class="lineno"> 5814</span>&#160;                options.proxied = options.animated;</div>
<div class="line"><a name="l05815"></a><span class="lineno"> 5815</span>&#160;            }</div>
<div class="line"><a name="l05816"></a><span class="lineno"> 5816</span>&#160;</div>
<div class="line"><a name="l05817"></a><span class="lineno"> 5817</span>&#160;            <span class="keywordflow">if</span> ( !options.proxiedDuration ) {</div>
<div class="line"><a name="l05818"></a><span class="lineno"> 5818</span>&#160;                options.proxiedDuration = options.duration;</div>
<div class="line"><a name="l05819"></a><span class="lineno"> 5819</span>&#160;            }</div>
<div class="line"><a name="l05820"></a><span class="lineno"> 5820</span>&#160;</div>
<div class="line"><a name="l05821"></a><span class="lineno"> 5821</span>&#160;            options.animated = $.isFunction( options.proxied ) ?</div>
<div class="line"><a name="l05822"></a><span class="lineno"> 5822</span>&#160;                options.proxied( animOptions ) :</div>
<div class="line"><a name="l05823"></a><span class="lineno"> 5823</span>&#160;                options.proxied;</div>
<div class="line"><a name="l05824"></a><span class="lineno"> 5824</span>&#160;</div>
<div class="line"><a name="l05825"></a><span class="lineno"> 5825</span>&#160;            options.duration = $.isFunction( options.proxiedDuration ) ?</div>
<div class="line"><a name="l05826"></a><span class="lineno"> 5826</span>&#160;                options.proxiedDuration( animOptions ) :</div>
<div class="line"><a name="l05827"></a><span class="lineno"> 5827</span>&#160;                options.proxiedDuration;</div>
<div class="line"><a name="l05828"></a><span class="lineno"> 5828</span>&#160;</div>
<div class="line"><a name="l05829"></a><span class="lineno"> 5829</span>&#160;            var animations = $.ui.accordion.animations,</div>
<div class="line"><a name="l05830"></a><span class="lineno"> 5830</span>&#160;                duration = options.duration,</div>
<div class="line"><a name="l05831"></a><span class="lineno"> 5831</span>&#160;                easing = options.animated;</div>
<div class="line"><a name="l05832"></a><span class="lineno"> 5832</span>&#160;</div>
<div class="line"><a name="l05833"></a><span class="lineno"> 5833</span>&#160;            <span class="keywordflow">if</span> ( easing &amp;&amp; !animations[ easing ] &amp;&amp; !$.easing[ easing ] ) {</div>
<div class="line"><a name="l05834"></a><span class="lineno"> 5834</span>&#160;                easing = <span class="stringliteral">&quot;slide&quot;</span>;</div>
<div class="line"><a name="l05835"></a><span class="lineno"> 5835</span>&#160;            }</div>
<div class="line"><a name="l05836"></a><span class="lineno"> 5836</span>&#160;            <span class="keywordflow">if</span> ( !animations[ easing ] ) {</div>
<div class="line"><a name="l05837"></a><span class="lineno"> 5837</span>&#160;                animations[ easing ] = <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l05838"></a><span class="lineno"> 5838</span>&#160;                    this.slide( options, {</div>
<div class="line"><a name="l05839"></a><span class="lineno"> 5839</span>&#160;                        easing: easing,</div>
<div class="line"><a name="l05840"></a><span class="lineno"> 5840</span>&#160;                        duration: duration || 700</div>
<div class="line"><a name="l05841"></a><span class="lineno"> 5841</span>&#160;                    });</div>
<div class="line"><a name="l05842"></a><span class="lineno"> 5842</span>&#160;                };</div>
<div class="line"><a name="l05843"></a><span class="lineno"> 5843</span>&#160;            }</div>
<div class="line"><a name="l05844"></a><span class="lineno"> 5844</span>&#160;</div>
<div class="line"><a name="l05845"></a><span class="lineno"> 5845</span>&#160;            animations[ easing ]( animOptions );</div>
<div class="line"><a name="l05846"></a><span class="lineno"> 5846</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05847"></a><span class="lineno"> 5847</span>&#160;            <span class="keywordflow">if</span> ( options.collapsible &amp;&amp; clickedIsActive ) {</div>
<div class="line"><a name="l05848"></a><span class="lineno"> 5848</span>&#160;                toShow.toggle();</div>
<div class="line"><a name="l05849"></a><span class="lineno"> 5849</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l05850"></a><span class="lineno"> 5850</span>&#160;                toHide.hide();</div>
<div class="line"><a name="l05851"></a><span class="lineno"> 5851</span>&#160;                toShow.show();</div>
<div class="line"><a name="l05852"></a><span class="lineno"> 5852</span>&#160;            }</div>
<div class="line"><a name="l05853"></a><span class="lineno"> 5853</span>&#160;</div>
<div class="line"><a name="l05854"></a><span class="lineno"> 5854</span>&#160;            complete( <span class="keyword">true</span> );</div>
<div class="line"><a name="l05855"></a><span class="lineno"> 5855</span>&#160;        }</div>
<div class="line"><a name="l05856"></a><span class="lineno"> 5856</span>&#160;</div>
<div class="line"><a name="l05857"></a><span class="lineno"> 5857</span>&#160;        <span class="comment">// TODO assert that the blur and focus triggers are really necessary, remove otherwise</span></div>
<div class="line"><a name="l05858"></a><span class="lineno"> 5858</span>&#160;        toHide.prev()</div>
<div class="line"><a name="l05859"></a><span class="lineno"> 5859</span>&#160;            .attr({</div>
<div class="line"><a name="l05860"></a><span class="lineno"> 5860</span>&#160;                <span class="stringliteral">&quot;aria-expanded&quot;</span>: <span class="stringliteral">&quot;false&quot;</span>,</div>
<div class="line"><a name="l05861"></a><span class="lineno"> 5861</span>&#160;                <span class="stringliteral">&quot;aria-selected&quot;</span>: <span class="stringliteral">&quot;false&quot;</span>,</div>
<div class="line"><a name="l05862"></a><span class="lineno"> 5862</span>&#160;                tabIndex: -1</div>
<div class="line"><a name="l05863"></a><span class="lineno"> 5863</span>&#160;            })</div>
<div class="line"><a name="l05864"></a><span class="lineno"> 5864</span>&#160;            .blur();</div>
<div class="line"><a name="l05865"></a><span class="lineno"> 5865</span>&#160;        toShow.prev()</div>
<div class="line"><a name="l05866"></a><span class="lineno"> 5866</span>&#160;            .attr({</div>
<div class="line"><a name="l05867"></a><span class="lineno"> 5867</span>&#160;                <span class="stringliteral">&quot;aria-expanded&quot;</span>: <span class="stringliteral">&quot;true&quot;</span>,</div>
<div class="line"><a name="l05868"></a><span class="lineno"> 5868</span>&#160;                <span class="stringliteral">&quot;aria-selected&quot;</span>: <span class="stringliteral">&quot;true&quot;</span>,</div>
<div class="line"><a name="l05869"></a><span class="lineno"> 5869</span>&#160;                tabIndex: 0</div>
<div class="line"><a name="l05870"></a><span class="lineno"> 5870</span>&#160;            })</div>
<div class="line"><a name="l05871"></a><span class="lineno"> 5871</span>&#160;            .focus();</div>
<div class="line"><a name="l05872"></a><span class="lineno"> 5872</span>&#160;    },</div>
<div class="line"><a name="l05873"></a><span class="lineno"> 5873</span>&#160;</div>
<div class="line"><a name="l05874"></a><span class="lineno"> 5874</span>&#160;    _completed: <span class="keyword">function</span>( cancel ) {</div>
<div class="line"><a name="l05875"></a><span class="lineno"> 5875</span>&#160;        this.running = cancel ? 0 : --this.running;</div>
<div class="line"><a name="l05876"></a><span class="lineno"> 5876</span>&#160;        <span class="keywordflow">if</span> ( this.running ) {</div>
<div class="line"><a name="l05877"></a><span class="lineno"> 5877</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05878"></a><span class="lineno"> 5878</span>&#160;        }</div>
<div class="line"><a name="l05879"></a><span class="lineno"> 5879</span>&#160;</div>
<div class="line"><a name="l05880"></a><span class="lineno"> 5880</span>&#160;        <span class="keywordflow">if</span> ( this.options.clearStyle ) {</div>
<div class="line"><a name="l05881"></a><span class="lineno"> 5881</span>&#160;            this.toShow.add( this.toHide ).css({</div>
<div class="line"><a name="l05882"></a><span class="lineno"> 5882</span>&#160;                height: <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a name="l05883"></a><span class="lineno"> 5883</span>&#160;                overflow: <span class="stringliteral">&quot;&quot;</span></div>
<div class="line"><a name="l05884"></a><span class="lineno"> 5884</span>&#160;            });</div>
<div class="line"><a name="l05885"></a><span class="lineno"> 5885</span>&#160;        }</div>
<div class="line"><a name="l05886"></a><span class="lineno"> 5886</span>&#160;</div>
<div class="line"><a name="l05887"></a><span class="lineno"> 5887</span>&#160;        <span class="comment">// other classes are removed before the animation; this one needs to stay until completed</span></div>
<div class="line"><a name="l05888"></a><span class="lineno"> 5888</span>&#160;        this.toHide.removeClass( <span class="stringliteral">&quot;ui-accordion-content-active&quot;</span> );</div>
<div class="line"><a name="l05889"></a><span class="lineno"> 5889</span>&#160;        <span class="comment">// Work around for rendering bug in IE (#5421)</span></div>
<div class="line"><a name="l05890"></a><span class="lineno"> 5890</span>&#160;        <span class="keywordflow">if</span> ( this.toHide.length ) {</div>
<div class="line"><a name="l05891"></a><span class="lineno"> 5891</span>&#160;            this.toHide.parent()[0].className = this.toHide.parent()[0].className;</div>
<div class="line"><a name="l05892"></a><span class="lineno"> 5892</span>&#160;        }</div>
<div class="line"><a name="l05893"></a><span class="lineno"> 5893</span>&#160;</div>
<div class="line"><a name="l05894"></a><span class="lineno"> 5894</span>&#160;        this._trigger( <span class="stringliteral">&quot;change&quot;</span>, null, this.data );</div>
<div class="line"><a name="l05895"></a><span class="lineno"> 5895</span>&#160;    }</div>
<div class="line"><a name="l05896"></a><span class="lineno"> 5896</span>&#160;});</div>
<div class="line"><a name="l05897"></a><span class="lineno"> 5897</span>&#160;</div>
<div class="line"><a name="l05898"></a><span class="lineno"> 5898</span>&#160;$.extend( $.ui.accordion, {</div>
<div class="line"><a name="l05899"></a><span class="lineno"> 5899</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span>,</div>
<div class="line"><a name="l05900"></a><span class="lineno"> 5900</span>&#160;    animations: {</div>
<div class="line"><a name="l05901"></a><span class="lineno"> 5901</span>&#160;        slide: <span class="keyword">function</span>( options, additions ) {</div>
<div class="line"><a name="l05902"></a><span class="lineno"> 5902</span>&#160;            options = $.extend({</div>
<div class="line"><a name="l05903"></a><span class="lineno"> 5903</span>&#160;                easing: <span class="stringliteral">&quot;swing&quot;</span>,</div>
<div class="line"><a name="l05904"></a><span class="lineno"> 5904</span>&#160;                duration: 300</div>
<div class="line"><a name="l05905"></a><span class="lineno"> 5905</span>&#160;            }, options, additions );</div>
<div class="line"><a name="l05906"></a><span class="lineno"> 5906</span>&#160;            <span class="keywordflow">if</span> ( !options.toHide.size() ) {</div>
<div class="line"><a name="l05907"></a><span class="lineno"> 5907</span>&#160;                options.toShow.animate({</div>
<div class="line"><a name="l05908"></a><span class="lineno"> 5908</span>&#160;                    height: <span class="stringliteral">&quot;show&quot;</span>,</div>
<div class="line"><a name="l05909"></a><span class="lineno"> 5909</span>&#160;                    paddingTop: <span class="stringliteral">&quot;show&quot;</span>,</div>
<div class="line"><a name="l05910"></a><span class="lineno"> 5910</span>&#160;                    paddingBottom: <span class="stringliteral">&quot;show&quot;</span></div>
<div class="line"><a name="l05911"></a><span class="lineno"> 5911</span>&#160;                }, options );</div>
<div class="line"><a name="l05912"></a><span class="lineno"> 5912</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05913"></a><span class="lineno"> 5913</span>&#160;            }</div>
<div class="line"><a name="l05914"></a><span class="lineno"> 5914</span>&#160;            <span class="keywordflow">if</span> ( !options.toShow.size() ) {</div>
<div class="line"><a name="l05915"></a><span class="lineno"> 5915</span>&#160;                options.toHide.animate({</div>
<div class="line"><a name="l05916"></a><span class="lineno"> 5916</span>&#160;                    height: <span class="stringliteral">&quot;hide&quot;</span>,</div>
<div class="line"><a name="l05917"></a><span class="lineno"> 5917</span>&#160;                    paddingTop: <span class="stringliteral">&quot;hide&quot;</span>,</div>
<div class="line"><a name="l05918"></a><span class="lineno"> 5918</span>&#160;                    paddingBottom: <span class="stringliteral">&quot;hide&quot;</span></div>
<div class="line"><a name="l05919"></a><span class="lineno"> 5919</span>&#160;                }, options );</div>
<div class="line"><a name="l05920"></a><span class="lineno"> 5920</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l05921"></a><span class="lineno"> 5921</span>&#160;            }</div>
<div class="line"><a name="l05922"></a><span class="lineno"> 5922</span>&#160;            var overflow = options.toShow.css( <span class="stringliteral">&quot;overflow&quot;</span> ),</div>
<div class="line"><a name="l05923"></a><span class="lineno"> 5923</span>&#160;                percentDone = 0,</div>
<div class="line"><a name="l05924"></a><span class="lineno"> 5924</span>&#160;                showProps = {},</div>
<div class="line"><a name="l05925"></a><span class="lineno"> 5925</span>&#160;                hideProps = {},</div>
<div class="line"><a name="l05926"></a><span class="lineno"> 5926</span>&#160;                fxAttrs = [ <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;paddingTop&quot;</span>, <span class="stringliteral">&quot;paddingBottom&quot;</span> ],</div>
<div class="line"><a name="l05927"></a><span class="lineno"> 5927</span>&#160;                originalWidth;</div>
<div class="line"><a name="l05928"></a><span class="lineno"> 5928</span>&#160;            <span class="comment">// fix width before calculating height of hidden element</span></div>
<div class="line"><a name="l05929"></a><span class="lineno"> 5929</span>&#160;            var s = options.toShow;</div>
<div class="line"><a name="l05930"></a><span class="lineno"> 5930</span>&#160;            originalWidth = s[0].style.width;</div>
<div class="line"><a name="l05931"></a><span class="lineno"> 5931</span>&#160;            s.width( s.parent().width()</div>
<div class="line"><a name="l05932"></a><span class="lineno"> 5932</span>&#160;                - parseFloat( s.css( <span class="stringliteral">&quot;paddingLeft&quot;</span> ) )</div>
<div class="line"><a name="l05933"></a><span class="lineno"> 5933</span>&#160;                - parseFloat( s.css( <span class="stringliteral">&quot;paddingRight&quot;</span> ) )</div>
<div class="line"><a name="l05934"></a><span class="lineno"> 5934</span>&#160;                - ( parseFloat( s.css( <span class="stringliteral">&quot;borderLeftWidth&quot;</span> ) ) || 0 )</div>
<div class="line"><a name="l05935"></a><span class="lineno"> 5935</span>&#160;                - ( parseFloat( s.css( <span class="stringliteral">&quot;borderRightWidth&quot;</span> ) ) || 0 ) );</div>
<div class="line"><a name="l05936"></a><span class="lineno"> 5936</span>&#160;</div>
<div class="line"><a name="l05937"></a><span class="lineno"> 5937</span>&#160;            $.each( fxAttrs, <span class="keyword">function</span>( i, prop ) {</div>
<div class="line"><a name="l05938"></a><span class="lineno"> 5938</span>&#160;                hideProps[ prop ] = <span class="stringliteral">&quot;hide&quot;</span>;</div>
<div class="line"><a name="l05939"></a><span class="lineno"> 5939</span>&#160;</div>
<div class="line"><a name="l05940"></a><span class="lineno"> 5940</span>&#160;                var parts = ( <span class="stringliteral">&quot;&quot;</span> + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );</div>
<div class="line"><a name="l05941"></a><span class="lineno"> 5941</span>&#160;                showProps[ prop ] = {</div>
<div class="line"><a name="l05942"></a><span class="lineno"> 5942</span>&#160;                    value: parts[ 1 ],</div>
<div class="line"><a name="l05943"></a><span class="lineno"> 5943</span>&#160;                    unit: parts[ 2 ] || <span class="stringliteral">&quot;px&quot;</span></div>
<div class="line"><a name="l05944"></a><span class="lineno"> 5944</span>&#160;                };</div>
<div class="line"><a name="l05945"></a><span class="lineno"> 5945</span>&#160;            });</div>
<div class="line"><a name="l05946"></a><span class="lineno"> 5946</span>&#160;            options.toShow.css({ height: 0, overflow: <span class="stringliteral">&quot;hidden&quot;</span> }).show();</div>
<div class="line"><a name="l05947"></a><span class="lineno"> 5947</span>&#160;            options.toHide</div>
<div class="line"><a name="l05948"></a><span class="lineno"> 5948</span>&#160;                .filter( <span class="stringliteral">&quot;:hidden&quot;</span> )</div>
<div class="line"><a name="l05949"></a><span class="lineno"> 5949</span>&#160;                    .each( options.complete )</div>
<div class="line"><a name="l05950"></a><span class="lineno"> 5950</span>&#160;                .end()</div>
<div class="line"><a name="l05951"></a><span class="lineno"> 5951</span>&#160;                .filter( <span class="stringliteral">&quot;:visible&quot;</span> )</div>
<div class="line"><a name="l05952"></a><span class="lineno"> 5952</span>&#160;                .animate( hideProps, {</div>
<div class="line"><a name="l05953"></a><span class="lineno"> 5953</span>&#160;                step: <span class="keyword">function</span>( now, settings ) {</div>
<div class="line"><a name="l05954"></a><span class="lineno"> 5954</span>&#160;                    <span class="comment">// only calculate the percent when animating height</span></div>
<div class="line"><a name="l05955"></a><span class="lineno"> 5955</span>&#160;                    <span class="comment">// IE gets very inconsistent results when animating elements</span></div>
<div class="line"><a name="l05956"></a><span class="lineno"> 5956</span>&#160;                    <span class="comment">// with small values, which is common for padding</span></div>
<div class="line"><a name="l05957"></a><span class="lineno"> 5957</span>&#160;                    <span class="keywordflow">if</span> ( settings.prop == <span class="stringliteral">&quot;height&quot;</span> ) {</div>
<div class="line"><a name="l05958"></a><span class="lineno"> 5958</span>&#160;                        percentDone = ( settings.end - settings.start === 0 ) ? 0 :</div>
<div class="line"><a name="l05959"></a><span class="lineno"> 5959</span>&#160;                            ( settings.now - settings.start ) / ( settings.end - settings.start );</div>
<div class="line"><a name="l05960"></a><span class="lineno"> 5960</span>&#160;                    }</div>
<div class="line"><a name="l05961"></a><span class="lineno"> 5961</span>&#160;</div>
<div class="line"><a name="l05962"></a><span class="lineno"> 5962</span>&#160;                    options.toShow[ 0 ].style[ settings.prop ] =</div>
<div class="line"><a name="l05963"></a><span class="lineno"> 5963</span>&#160;                        ( percentDone * showProps[ settings.prop ].value )</div>
<div class="line"><a name="l05964"></a><span class="lineno"> 5964</span>&#160;                        + showProps[ settings.prop ].unit;</div>
<div class="line"><a name="l05965"></a><span class="lineno"> 5965</span>&#160;                },</div>
<div class="line"><a name="l05966"></a><span class="lineno"> 5966</span>&#160;                duration: options.duration,</div>
<div class="line"><a name="l05967"></a><span class="lineno"> 5967</span>&#160;                easing: options.easing,</div>
<div class="line"><a name="l05968"></a><span class="lineno"> 5968</span>&#160;                complete: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l05969"></a><span class="lineno"> 5969</span>&#160;                    <span class="keywordflow">if</span> ( !options.autoHeight ) {</div>
<div class="line"><a name="l05970"></a><span class="lineno"> 5970</span>&#160;                        options.toShow.css( <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;&quot;</span> );</div>
<div class="line"><a name="l05971"></a><span class="lineno"> 5971</span>&#160;                    }</div>
<div class="line"><a name="l05972"></a><span class="lineno"> 5972</span>&#160;                    options.toShow.css({</div>
<div class="line"><a name="l05973"></a><span class="lineno"> 5973</span>&#160;                        width: originalWidth,</div>
<div class="line"><a name="l05974"></a><span class="lineno"> 5974</span>&#160;                        overflow: overflow</div>
<div class="line"><a name="l05975"></a><span class="lineno"> 5975</span>&#160;                    });</div>
<div class="line"><a name="l05976"></a><span class="lineno"> 5976</span>&#160;                    options.complete();</div>
<div class="line"><a name="l05977"></a><span class="lineno"> 5977</span>&#160;                }</div>
<div class="line"><a name="l05978"></a><span class="lineno"> 5978</span>&#160;            });</div>
<div class="line"><a name="l05979"></a><span class="lineno"> 5979</span>&#160;        },</div>
<div class="line"><a name="l05980"></a><span class="lineno"> 5980</span>&#160;        bounceslide: <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l05981"></a><span class="lineno"> 5981</span>&#160;            this.slide( options, {</div>
<div class="line"><a name="l05982"></a><span class="lineno"> 5982</span>&#160;                easing: options.down ? <span class="stringliteral">&quot;easeOutBounce&quot;</span> : <span class="stringliteral">&quot;swing&quot;</span>,</div>
<div class="line"><a name="l05983"></a><span class="lineno"> 5983</span>&#160;                duration: options.down ? 1000 : 200</div>
<div class="line"><a name="l05984"></a><span class="lineno"> 5984</span>&#160;            });</div>
<div class="line"><a name="l05985"></a><span class="lineno"> 5985</span>&#160;        }</div>
<div class="line"><a name="l05986"></a><span class="lineno"> 5986</span>&#160;    }</div>
<div class="line"><a name="l05987"></a><span class="lineno"> 5987</span>&#160;});</div>
<div class="line"><a name="l05988"></a><span class="lineno"> 5988</span>&#160;</div>
<div class="line"><a name="l05989"></a><span class="lineno"> 5989</span>&#160;})( jQuery );</div>
<div class="line"><a name="l05990"></a><span class="lineno"> 5990</span>&#160;</div>
<div class="line"><a name="l05991"></a><span class="lineno"> 5991</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l05992"></a><span class="lineno"> 5992</span>&#160;</div>
<div class="line"><a name="l05993"></a><span class="lineno"> 5993</span>&#160;<span class="comment">// used to prevent race conditions with remote data sources</span></div>
<div class="line"><a name="l05994"></a><span class="lineno"> 5994</span>&#160;var requestIndex = 0;</div>
<div class="line"><a name="l05995"></a><span class="lineno"> 5995</span>&#160;</div>
<div class="line"><a name="l05996"></a><span class="lineno"> 5996</span>&#160;$.widget( <span class="stringliteral">&quot;ui.autocomplete&quot;</span>, {</div>
<div class="line"><a name="l05997"></a><span class="lineno"> 5997</span>&#160;    options: {</div>
<div class="line"><a name="l05998"></a><span class="lineno"> 5998</span>&#160;        appendTo: <span class="stringliteral">&quot;body&quot;</span>,</div>
<div class="line"><a name="l05999"></a><span class="lineno"> 5999</span>&#160;        autoFocus: <span class="keyword">false</span>,</div>
<div class="line"><a name="l06000"></a><span class="lineno"> 6000</span>&#160;        delay: 300,</div>
<div class="line"><a name="l06001"></a><span class="lineno"> 6001</span>&#160;        minLength: 1,</div>
<div class="line"><a name="l06002"></a><span class="lineno"> 6002</span>&#160;        position: {</div>
<div class="line"><a name="l06003"></a><span class="lineno"> 6003</span>&#160;            my: <span class="stringliteral">&quot;left top&quot;</span>,</div>
<div class="line"><a name="l06004"></a><span class="lineno"> 6004</span>&#160;            at: <span class="stringliteral">&quot;left bottom&quot;</span>,</div>
<div class="line"><a name="l06005"></a><span class="lineno"> 6005</span>&#160;            collision: <span class="stringliteral">&quot;none&quot;</span></div>
<div class="line"><a name="l06006"></a><span class="lineno"> 6006</span>&#160;        },</div>
<div class="line"><a name="l06007"></a><span class="lineno"> 6007</span>&#160;        source: null</div>
<div class="line"><a name="l06008"></a><span class="lineno"> 6008</span>&#160;    },</div>
<div class="line"><a name="l06009"></a><span class="lineno"> 6009</span>&#160;</div>
<div class="line"><a name="l06010"></a><span class="lineno"> 6010</span>&#160;    pending: 0,</div>
<div class="line"><a name="l06011"></a><span class="lineno"> 6011</span>&#160;</div>
<div class="line"><a name="l06012"></a><span class="lineno"> 6012</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06013"></a><span class="lineno"> 6013</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l06014"></a><span class="lineno"> 6014</span>&#160;            doc = this.element[ 0 ].ownerDocument,</div>
<div class="line"><a name="l06015"></a><span class="lineno"> 6015</span>&#160;            suppressKeyPress;</div>
<div class="line"><a name="l06016"></a><span class="lineno"> 6016</span>&#160;        this.isMultiLine = this.element.is( <span class="stringliteral">&quot;textarea&quot;</span> );</div>
<div class="line"><a name="l06017"></a><span class="lineno"> 6017</span>&#160;</div>
<div class="line"><a name="l06018"></a><span class="lineno"> 6018</span>&#160;        this.element</div>
<div class="line"><a name="l06019"></a><span class="lineno"> 6019</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-autocomplete-input&quot;</span> )</div>
<div class="line"><a name="l06020"></a><span class="lineno"> 6020</span>&#160;            .attr( <span class="stringliteral">&quot;autocomplete&quot;</span>, <span class="stringliteral">&quot;off&quot;</span> )</div>
<div class="line"><a name="l06021"></a><span class="lineno"> 6021</span>&#160;            <span class="comment">// TODO verify these actually work as intended</span></div>
<div class="line"><a name="l06022"></a><span class="lineno"> 6022</span>&#160;            .attr({</div>
<div class="line"><a name="l06023"></a><span class="lineno"> 6023</span>&#160;                role: <span class="stringliteral">&quot;textbox&quot;</span>,</div>
<div class="line"><a name="l06024"></a><span class="lineno"> 6024</span>&#160;                <span class="stringliteral">&quot;aria-autocomplete&quot;</span>: <span class="stringliteral">&quot;list&quot;</span>,</div>
<div class="line"><a name="l06025"></a><span class="lineno"> 6025</span>&#160;                <span class="stringliteral">&quot;aria-haspopup&quot;</span>: <span class="stringliteral">&quot;true&quot;</span></div>
<div class="line"><a name="l06026"></a><span class="lineno"> 6026</span>&#160;            })</div>
<div class="line"><a name="l06027"></a><span class="lineno"> 6027</span>&#160;            .bind( <span class="stringliteral">&quot;keydown.autocomplete&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06028"></a><span class="lineno"> 6028</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.options.disabled || <span class="keyword">self</span>.element.propAttr( <span class="stringliteral">&quot;readOnly&quot;</span> ) ) {</div>
<div class="line"><a name="l06029"></a><span class="lineno"> 6029</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06030"></a><span class="lineno"> 6030</span>&#160;                }</div>
<div class="line"><a name="l06031"></a><span class="lineno"> 6031</span>&#160;</div>
<div class="line"><a name="l06032"></a><span class="lineno"> 6032</span>&#160;                suppressKeyPress = <span class="keyword">false</span>;</div>
<div class="line"><a name="l06033"></a><span class="lineno"> 6033</span>&#160;                var keyCode = $.ui.keyCode;</div>
<div class="line"><a name="l06034"></a><span class="lineno"> 6034</span>&#160;                <span class="keywordflow">switch</span>( event.keyCode ) {</div>
<div class="line"><a name="l06035"></a><span class="lineno"> 6035</span>&#160;                <span class="keywordflow">case</span> keyCode.PAGE_UP:</div>
<div class="line"><a name="l06036"></a><span class="lineno"> 6036</span>&#160;                    <span class="keyword">self</span>._move( <span class="stringliteral">&quot;previousPage&quot;</span>, event );</div>
<div class="line"><a name="l06037"></a><span class="lineno"> 6037</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06038"></a><span class="lineno"> 6038</span>&#160;                <span class="keywordflow">case</span> keyCode.PAGE_DOWN:</div>
<div class="line"><a name="l06039"></a><span class="lineno"> 6039</span>&#160;                    <span class="keyword">self</span>._move( <span class="stringliteral">&quot;nextPage&quot;</span>, event );</div>
<div class="line"><a name="l06040"></a><span class="lineno"> 6040</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06041"></a><span class="lineno"> 6041</span>&#160;                <span class="keywordflow">case</span> keyCode.UP:</div>
<div class="line"><a name="l06042"></a><span class="lineno"> 6042</span>&#160;                    <span class="keyword">self</span>._keyEvent( <span class="stringliteral">&quot;previous&quot;</span>, event );</div>
<div class="line"><a name="l06043"></a><span class="lineno"> 6043</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06044"></a><span class="lineno"> 6044</span>&#160;                <span class="keywordflow">case</span> keyCode.DOWN:</div>
<div class="line"><a name="l06045"></a><span class="lineno"> 6045</span>&#160;                    <span class="keyword">self</span>._keyEvent( <span class="stringliteral">&quot;next&quot;</span>, event );</div>
<div class="line"><a name="l06046"></a><span class="lineno"> 6046</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06047"></a><span class="lineno"> 6047</span>&#160;                <span class="keywordflow">case</span> keyCode.ENTER:</div>
<div class="line"><a name="l06048"></a><span class="lineno"> 6048</span>&#160;                <span class="keywordflow">case</span> keyCode.NUMPAD_ENTER:</div>
<div class="line"><a name="l06049"></a><span class="lineno"> 6049</span>&#160;                    <span class="comment">// when menu is open and has focus</span></div>
<div class="line"><a name="l06050"></a><span class="lineno"> 6050</span>&#160;                    <span class="keywordflow">if</span> ( <span class="keyword">self</span>.menu.active ) {</div>
<div class="line"><a name="l06051"></a><span class="lineno"> 6051</span>&#160;                        <span class="comment">// #6055 - Opera still allows the keypress to occur</span></div>
<div class="line"><a name="l06052"></a><span class="lineno"> 6052</span>&#160;                        <span class="comment">// which causes forms to submit</span></div>
<div class="line"><a name="l06053"></a><span class="lineno"> 6053</span>&#160;                        suppressKeyPress = <span class="keyword">true</span>;</div>
<div class="line"><a name="l06054"></a><span class="lineno"> 6054</span>&#160;                        <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l06055"></a><span class="lineno"> 6055</span>&#160;                    }</div>
<div class="line"><a name="l06056"></a><span class="lineno"> 6056</span>&#160;                    <span class="comment">//passthrough - ENTER and TAB both select the current element</span></div>
<div class="line"><a name="l06057"></a><span class="lineno"> 6057</span>&#160;                <span class="keywordflow">case</span> keyCode.TAB:</div>
<div class="line"><a name="l06058"></a><span class="lineno"> 6058</span>&#160;                    <span class="keywordflow">if</span> ( !<span class="keyword">self</span>.menu.active ) {</div>
<div class="line"><a name="l06059"></a><span class="lineno"> 6059</span>&#160;                        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06060"></a><span class="lineno"> 6060</span>&#160;                    }</div>
<div class="line"><a name="l06061"></a><span class="lineno"> 6061</span>&#160;                    <span class="keyword">self</span>.menu.select( event );</div>
<div class="line"><a name="l06062"></a><span class="lineno"> 6062</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06063"></a><span class="lineno"> 6063</span>&#160;                <span class="keywordflow">case</span> keyCode.ESCAPE:</div>
<div class="line"><a name="l06064"></a><span class="lineno"> 6064</span>&#160;                    <span class="keyword">self</span>.element.val( <span class="keyword">self</span>.term );</div>
<div class="line"><a name="l06065"></a><span class="lineno"> 6065</span>&#160;                    <span class="keyword">self</span>.close( event );</div>
<div class="line"><a name="l06066"></a><span class="lineno"> 6066</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06067"></a><span class="lineno"> 6067</span>&#160;                <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l06068"></a><span class="lineno"> 6068</span>&#160;                    <span class="comment">// keypress is triggered before the input value is changed</span></div>
<div class="line"><a name="l06069"></a><span class="lineno"> 6069</span>&#160;                    clearTimeout( <span class="keyword">self</span>.searching );</div>
<div class="line"><a name="l06070"></a><span class="lineno"> 6070</span>&#160;                    <span class="keyword">self</span>.searching = setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06071"></a><span class="lineno"> 6071</span>&#160;                        <span class="comment">// only search if the value has changed</span></div>
<div class="line"><a name="l06072"></a><span class="lineno"> 6072</span>&#160;                        <span class="keywordflow">if</span> ( <span class="keyword">self</span>.term != <span class="keyword">self</span>.element.val() ) {</div>
<div class="line"><a name="l06073"></a><span class="lineno"> 6073</span>&#160;                            <span class="keyword">self</span>.selectedItem = null;</div>
<div class="line"><a name="l06074"></a><span class="lineno"> 6074</span>&#160;                            <span class="keyword">self</span>.search( null, event );</div>
<div class="line"><a name="l06075"></a><span class="lineno"> 6075</span>&#160;                        }</div>
<div class="line"><a name="l06076"></a><span class="lineno"> 6076</span>&#160;                    }, <span class="keyword">self</span>.options.delay );</div>
<div class="line"><a name="l06077"></a><span class="lineno"> 6077</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l06078"></a><span class="lineno"> 6078</span>&#160;                }</div>
<div class="line"><a name="l06079"></a><span class="lineno"> 6079</span>&#160;            })</div>
<div class="line"><a name="l06080"></a><span class="lineno"> 6080</span>&#160;            .bind( <span class="stringliteral">&quot;keypress.autocomplete&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06081"></a><span class="lineno"> 6081</span>&#160;                <span class="keywordflow">if</span> ( suppressKeyPress ) {</div>
<div class="line"><a name="l06082"></a><span class="lineno"> 6082</span>&#160;                    suppressKeyPress = <span class="keyword">false</span>;</div>
<div class="line"><a name="l06083"></a><span class="lineno"> 6083</span>&#160;                    <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l06084"></a><span class="lineno"> 6084</span>&#160;                }</div>
<div class="line"><a name="l06085"></a><span class="lineno"> 6085</span>&#160;            })</div>
<div class="line"><a name="l06086"></a><span class="lineno"> 6086</span>&#160;            .bind( <span class="stringliteral">&quot;focus.autocomplete&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06087"></a><span class="lineno"> 6087</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.options.disabled ) {</div>
<div class="line"><a name="l06088"></a><span class="lineno"> 6088</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06089"></a><span class="lineno"> 6089</span>&#160;                }</div>
<div class="line"><a name="l06090"></a><span class="lineno"> 6090</span>&#160;</div>
<div class="line"><a name="l06091"></a><span class="lineno"> 6091</span>&#160;                <span class="keyword">self</span>.selectedItem = null;</div>
<div class="line"><a name="l06092"></a><span class="lineno"> 6092</span>&#160;                <span class="keyword">self</span>.previous = <span class="keyword">self</span>.element.val();</div>
<div class="line"><a name="l06093"></a><span class="lineno"> 6093</span>&#160;            })</div>
<div class="line"><a name="l06094"></a><span class="lineno"> 6094</span>&#160;            .bind( <span class="stringliteral">&quot;blur.autocomplete&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06095"></a><span class="lineno"> 6095</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.options.disabled ) {</div>
<div class="line"><a name="l06096"></a><span class="lineno"> 6096</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06097"></a><span class="lineno"> 6097</span>&#160;                }</div>
<div class="line"><a name="l06098"></a><span class="lineno"> 6098</span>&#160;</div>
<div class="line"><a name="l06099"></a><span class="lineno"> 6099</span>&#160;                clearTimeout( <span class="keyword">self</span>.searching );</div>
<div class="line"><a name="l06100"></a><span class="lineno"> 6100</span>&#160;                <span class="comment">// clicks on the menu (or a button to trigger a search) will cause a blur event</span></div>
<div class="line"><a name="l06101"></a><span class="lineno"> 6101</span>&#160;                <span class="keyword">self</span>.closing = setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06102"></a><span class="lineno"> 6102</span>&#160;                    <span class="keyword">self</span>.close( event );</div>
<div class="line"><a name="l06103"></a><span class="lineno"> 6103</span>&#160;                    <span class="keyword">self</span>._change( event );</div>
<div class="line"><a name="l06104"></a><span class="lineno"> 6104</span>&#160;                }, 150 );</div>
<div class="line"><a name="l06105"></a><span class="lineno"> 6105</span>&#160;            });</div>
<div class="line"><a name="l06106"></a><span class="lineno"> 6106</span>&#160;        this._initSource();</div>
<div class="line"><a name="l06107"></a><span class="lineno"> 6107</span>&#160;        this.menu = $( <span class="stringliteral">&quot;&lt;ul&gt;&lt;/ul&gt;&quot;</span> )</div>
<div class="line"><a name="l06108"></a><span class="lineno"> 6108</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-autocomplete&quot;</span> )</div>
<div class="line"><a name="l06109"></a><span class="lineno"> 6109</span>&#160;            .appendTo( $( this.options.appendTo || <span class="stringliteral">&quot;body&quot;</span>, doc )[0] )</div>
<div class="line"><a name="l06110"></a><span class="lineno"> 6110</span>&#160;            <span class="comment">// prevent the close-on-blur in case of a &quot;slow&quot; click on the menu (long mousedown)</span></div>
<div class="line"><a name="l06111"></a><span class="lineno"> 6111</span>&#160;            .mousedown(<span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06112"></a><span class="lineno"> 6112</span>&#160;                <span class="comment">// clicking on the scrollbar causes focus to shift to the body</span></div>
<div class="line"><a name="l06113"></a><span class="lineno"> 6113</span>&#160;                <span class="comment">// but we can&#39;t detect a mouseup or a click immediately afterward</span></div>
<div class="line"><a name="l06114"></a><span class="lineno"> 6114</span>&#160;                <span class="comment">// so we have to track the next mousedown and close the menu if</span></div>
<div class="line"><a name="l06115"></a><span class="lineno"> 6115</span>&#160;                <span class="comment">// the user clicks somewhere outside of the autocomplete</span></div>
<div class="line"><a name="l06116"></a><span class="lineno"> 6116</span>&#160;                var menuElement = <span class="keyword">self</span>.menu.element[ 0 ];</div>
<div class="line"><a name="l06117"></a><span class="lineno"> 6117</span>&#160;                <span class="keywordflow">if</span> ( !$( event.target ).closest( <span class="stringliteral">&quot;.ui-menu-item&quot;</span> ).length ) {</div>
<div class="line"><a name="l06118"></a><span class="lineno"> 6118</span>&#160;                    setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06119"></a><span class="lineno"> 6119</span>&#160;                        $( document ).one( <span class="stringliteral">&#39;mousedown&#39;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06120"></a><span class="lineno"> 6120</span>&#160;                            <span class="keywordflow">if</span> ( event.target !== <span class="keyword">self</span>.element[ 0 ] &amp;&amp;</div>
<div class="line"><a name="l06121"></a><span class="lineno"> 6121</span>&#160;                                event.target !== menuElement &amp;&amp;</div>
<div class="line"><a name="l06122"></a><span class="lineno"> 6122</span>&#160;                                !$.ui.contains( menuElement, event.target ) ) {</div>
<div class="line"><a name="l06123"></a><span class="lineno"> 6123</span>&#160;                                <span class="keyword">self</span>.close();</div>
<div class="line"><a name="l06124"></a><span class="lineno"> 6124</span>&#160;                            }</div>
<div class="line"><a name="l06125"></a><span class="lineno"> 6125</span>&#160;                        });</div>
<div class="line"><a name="l06126"></a><span class="lineno"> 6126</span>&#160;                    }, 1 );</div>
<div class="line"><a name="l06127"></a><span class="lineno"> 6127</span>&#160;                }</div>
<div class="line"><a name="l06128"></a><span class="lineno"> 6128</span>&#160;</div>
<div class="line"><a name="l06129"></a><span class="lineno"> 6129</span>&#160;                <span class="comment">// use another timeout to make sure the blur-event-handler on the input was already triggered</span></div>
<div class="line"><a name="l06130"></a><span class="lineno"> 6130</span>&#160;                setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06131"></a><span class="lineno"> 6131</span>&#160;                    clearTimeout( <span class="keyword">self</span>.closing );</div>
<div class="line"><a name="l06132"></a><span class="lineno"> 6132</span>&#160;                }, 13);</div>
<div class="line"><a name="l06133"></a><span class="lineno"> 6133</span>&#160;            })</div>
<div class="line"><a name="l06134"></a><span class="lineno"> 6134</span>&#160;            .menu({</div>
<div class="line"><a name="l06135"></a><span class="lineno"> 6135</span>&#160;                focus: <span class="keyword">function</span>( event, ui ) {</div>
<div class="line"><a name="l06136"></a><span class="lineno"> 6136</span>&#160;                    var item = ui.item.data( <span class="stringliteral">&quot;item.autocomplete&quot;</span> );</div>
<div class="line"><a name="l06137"></a><span class="lineno"> 6137</span>&#160;                    <span class="keywordflow">if</span> ( <span class="keyword">false</span> !== <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;focus&quot;</span>, event, { item: item } ) ) {</div>
<div class="line"><a name="l06138"></a><span class="lineno"> 6138</span>&#160;                        <span class="comment">// use value to match what will end up in the input, if it was a key event</span></div>
<div class="line"><a name="l06139"></a><span class="lineno"> 6139</span>&#160;                        <span class="keywordflow">if</span> ( /^key/.test(event.originalEvent.type) ) {</div>
<div class="line"><a name="l06140"></a><span class="lineno"> 6140</span>&#160;                            <span class="keyword">self</span>.element.val( item.value );</div>
<div class="line"><a name="l06141"></a><span class="lineno"> 6141</span>&#160;                        }</div>
<div class="line"><a name="l06142"></a><span class="lineno"> 6142</span>&#160;                    }</div>
<div class="line"><a name="l06143"></a><span class="lineno"> 6143</span>&#160;                },</div>
<div class="line"><a name="l06144"></a><span class="lineno"> 6144</span>&#160;                selected: <span class="keyword">function</span>( event, ui ) {</div>
<div class="line"><a name="l06145"></a><span class="lineno"> 6145</span>&#160;                    var item = ui.item.data( <span class="stringliteral">&quot;item.autocomplete&quot;</span> ),</div>
<div class="line"><a name="l06146"></a><span class="lineno"> 6146</span>&#160;                        previous = <span class="keyword">self</span>.previous;</div>
<div class="line"><a name="l06147"></a><span class="lineno"> 6147</span>&#160;</div>
<div class="line"><a name="l06148"></a><span class="lineno"> 6148</span>&#160;                    <span class="comment">// only trigger when focus was lost (click on menu)</span></div>
<div class="line"><a name="l06149"></a><span class="lineno"> 6149</span>&#160;                    <span class="keywordflow">if</span> ( <span class="keyword">self</span>.element[0] !== doc.activeElement ) {</div>
<div class="line"><a name="l06150"></a><span class="lineno"> 6150</span>&#160;                        <span class="keyword">self</span>.element.focus();</div>
<div class="line"><a name="l06151"></a><span class="lineno"> 6151</span>&#160;                        <span class="keyword">self</span>.previous = previous;</div>
<div class="line"><a name="l06152"></a><span class="lineno"> 6152</span>&#160;                        <span class="comment">// #6109 - IE triggers two focus events and the second</span></div>
<div class="line"><a name="l06153"></a><span class="lineno"> 6153</span>&#160;                        <span class="comment">// is asynchronous, so we need to reset the previous</span></div>
<div class="line"><a name="l06154"></a><span class="lineno"> 6154</span>&#160;                        <span class="comment">// term synchronously and asynchronously :-(</span></div>
<div class="line"><a name="l06155"></a><span class="lineno"> 6155</span>&#160;                        setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06156"></a><span class="lineno"> 6156</span>&#160;                            <span class="keyword">self</span>.previous = previous;</div>
<div class="line"><a name="l06157"></a><span class="lineno"> 6157</span>&#160;                            <span class="keyword">self</span>.selectedItem = item;</div>
<div class="line"><a name="l06158"></a><span class="lineno"> 6158</span>&#160;                        }, 1);</div>
<div class="line"><a name="l06159"></a><span class="lineno"> 6159</span>&#160;                    }</div>
<div class="line"><a name="l06160"></a><span class="lineno"> 6160</span>&#160;</div>
<div class="line"><a name="l06161"></a><span class="lineno"> 6161</span>&#160;                    <span class="keywordflow">if</span> ( <span class="keyword">false</span> !== <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;select&quot;</span>, event, { item: item } ) ) {</div>
<div class="line"><a name="l06162"></a><span class="lineno"> 6162</span>&#160;                        <span class="keyword">self</span>.element.val( item.value );</div>
<div class="line"><a name="l06163"></a><span class="lineno"> 6163</span>&#160;                    }</div>
<div class="line"><a name="l06164"></a><span class="lineno"> 6164</span>&#160;                    <span class="comment">// reset the term after the select event</span></div>
<div class="line"><a name="l06165"></a><span class="lineno"> 6165</span>&#160;                    <span class="comment">// this allows custom select handling to work properly</span></div>
<div class="line"><a name="l06166"></a><span class="lineno"> 6166</span>&#160;                    <span class="keyword">self</span>.term = <span class="keyword">self</span>.element.val();</div>
<div class="line"><a name="l06167"></a><span class="lineno"> 6167</span>&#160;</div>
<div class="line"><a name="l06168"></a><span class="lineno"> 6168</span>&#160;                    <span class="keyword">self</span>.close( event );</div>
<div class="line"><a name="l06169"></a><span class="lineno"> 6169</span>&#160;                    <span class="keyword">self</span>.selectedItem = item;</div>
<div class="line"><a name="l06170"></a><span class="lineno"> 6170</span>&#160;                },</div>
<div class="line"><a name="l06171"></a><span class="lineno"> 6171</span>&#160;                blur: <span class="keyword">function</span>( event, ui ) {</div>
<div class="line"><a name="l06172"></a><span class="lineno"> 6172</span>&#160;                    <span class="comment">// don&#39;t set the value of the text field if it&#39;s already correct</span></div>
<div class="line"><a name="l06173"></a><span class="lineno"> 6173</span>&#160;                    <span class="comment">// this prevents moving the cursor unnecessarily</span></div>
<div class="line"><a name="l06174"></a><span class="lineno"> 6174</span>&#160;                    <span class="keywordflow">if</span> ( <span class="keyword">self</span>.menu.element.is(<span class="stringliteral">&quot;:visible&quot;</span>) &amp;&amp;</div>
<div class="line"><a name="l06175"></a><span class="lineno"> 6175</span>&#160;                        ( <span class="keyword">self</span>.element.val() !== <span class="keyword">self</span>.term ) ) {</div>
<div class="line"><a name="l06176"></a><span class="lineno"> 6176</span>&#160;                        <span class="keyword">self</span>.element.val( <span class="keyword">self</span>.term );</div>
<div class="line"><a name="l06177"></a><span class="lineno"> 6177</span>&#160;                    }</div>
<div class="line"><a name="l06178"></a><span class="lineno"> 6178</span>&#160;                }</div>
<div class="line"><a name="l06179"></a><span class="lineno"> 6179</span>&#160;            })</div>
<div class="line"><a name="l06180"></a><span class="lineno"> 6180</span>&#160;            .zIndex( this.element.zIndex() + 1 )</div>
<div class="line"><a name="l06181"></a><span class="lineno"> 6181</span>&#160;            <span class="comment">// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781</span></div>
<div class="line"><a name="l06182"></a><span class="lineno"> 6182</span>&#160;            .css({ top: 0, left: 0 })</div>
<div class="line"><a name="l06183"></a><span class="lineno"> 6183</span>&#160;            .hide()</div>
<div class="line"><a name="l06184"></a><span class="lineno"> 6184</span>&#160;            .data( <span class="stringliteral">&quot;menu&quot;</span> );</div>
<div class="line"><a name="l06185"></a><span class="lineno"> 6185</span>&#160;        <span class="keywordflow">if</span> ( $.fn.bgiframe ) {</div>
<div class="line"><a name="l06186"></a><span class="lineno"> 6186</span>&#160;             this.menu.element.bgiframe();</div>
<div class="line"><a name="l06187"></a><span class="lineno"> 6187</span>&#160;        }</div>
<div class="line"><a name="l06188"></a><span class="lineno"> 6188</span>&#160;        <span class="comment">// turning off autocomplete prevents the browser from remembering the</span></div>
<div class="line"><a name="l06189"></a><span class="lineno"> 6189</span>&#160;        <span class="comment">// value when navigating through history, so we re-enable autocomplete</span></div>
<div class="line"><a name="l06190"></a><span class="lineno"> 6190</span>&#160;        <span class="comment">// if the page is unloaded before the widget is destroyed. #7790</span></div>
<div class="line"><a name="l06191"></a><span class="lineno"> 6191</span>&#160;        <span class="keyword">self</span>.beforeunloadHandler = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06192"></a><span class="lineno"> 6192</span>&#160;            <span class="keyword">self</span>.element.removeAttr( <span class="stringliteral">&quot;autocomplete&quot;</span> );</div>
<div class="line"><a name="l06193"></a><span class="lineno"> 6193</span>&#160;        };</div>
<div class="line"><a name="l06194"></a><span class="lineno"> 6194</span>&#160;        $( window ).bind( <span class="stringliteral">&quot;beforeunload&quot;</span>, <span class="keyword">self</span>.beforeunloadHandler );</div>
<div class="line"><a name="l06195"></a><span class="lineno"> 6195</span>&#160;    },</div>
<div class="line"><a name="l06196"></a><span class="lineno"> 6196</span>&#160;</div>
<div class="line"><a name="l06197"></a><span class="lineno"> 6197</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06198"></a><span class="lineno"> 6198</span>&#160;        this.element</div>
<div class="line"><a name="l06199"></a><span class="lineno"> 6199</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-autocomplete-input&quot;</span> )</div>
<div class="line"><a name="l06200"></a><span class="lineno"> 6200</span>&#160;            .removeAttr( <span class="stringliteral">&quot;autocomplete&quot;</span> )</div>
<div class="line"><a name="l06201"></a><span class="lineno"> 6201</span>&#160;            .removeAttr( <span class="stringliteral">&quot;role&quot;</span> )</div>
<div class="line"><a name="l06202"></a><span class="lineno"> 6202</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-autocomplete&quot;</span> )</div>
<div class="line"><a name="l06203"></a><span class="lineno"> 6203</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-haspopup&quot;</span> );</div>
<div class="line"><a name="l06204"></a><span class="lineno"> 6204</span>&#160;        this.menu.element.remove();</div>
<div class="line"><a name="l06205"></a><span class="lineno"> 6205</span>&#160;        $( window ).unbind( <span class="stringliteral">&quot;beforeunload&quot;</span>, this.beforeunloadHandler );</div>
<div class="line"><a name="l06206"></a><span class="lineno"> 6206</span>&#160;        $.Widget.prototype.destroy.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l06207"></a><span class="lineno"> 6207</span>&#160;    },</div>
<div class="line"><a name="l06208"></a><span class="lineno"> 6208</span>&#160;</div>
<div class="line"><a name="l06209"></a><span class="lineno"> 6209</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l06210"></a><span class="lineno"> 6210</span>&#160;        $.Widget.prototype._setOption.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l06211"></a><span class="lineno"> 6211</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;source&quot;</span> ) {</div>
<div class="line"><a name="l06212"></a><span class="lineno"> 6212</span>&#160;            this._initSource();</div>
<div class="line"><a name="l06213"></a><span class="lineno"> 6213</span>&#160;        }</div>
<div class="line"><a name="l06214"></a><span class="lineno"> 6214</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;appendTo&quot;</span> ) {</div>
<div class="line"><a name="l06215"></a><span class="lineno"> 6215</span>&#160;            this.menu.element.appendTo( $( value || <span class="stringliteral">&quot;body&quot;</span>, this.element[0].ownerDocument )[0] )</div>
<div class="line"><a name="l06216"></a><span class="lineno"> 6216</span>&#160;        }</div>
<div class="line"><a name="l06217"></a><span class="lineno"> 6217</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;disabled&quot;</span> &amp;&amp; value &amp;&amp; this.xhr ) {</div>
<div class="line"><a name="l06218"></a><span class="lineno"> 6218</span>&#160;            this.xhr.abort();</div>
<div class="line"><a name="l06219"></a><span class="lineno"> 6219</span>&#160;        }</div>
<div class="line"><a name="l06220"></a><span class="lineno"> 6220</span>&#160;    },</div>
<div class="line"><a name="l06221"></a><span class="lineno"> 6221</span>&#160;</div>
<div class="line"><a name="l06222"></a><span class="lineno"> 6222</span>&#160;    _initSource: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06223"></a><span class="lineno"> 6223</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l06224"></a><span class="lineno"> 6224</span>&#160;            array,</div>
<div class="line"><a name="l06225"></a><span class="lineno"> 6225</span>&#160;            url;</div>
<div class="line"><a name="l06226"></a><span class="lineno"> 6226</span>&#160;        <span class="keywordflow">if</span> ( $.isArray(this.options.source) ) {</div>
<div class="line"><a name="l06227"></a><span class="lineno"> 6227</span>&#160;            array = this.options.source;</div>
<div class="line"><a name="l06228"></a><span class="lineno"> 6228</span>&#160;            this.source = <span class="keyword">function</span>( request, response ) {</div>
<div class="line"><a name="l06229"></a><span class="lineno"> 6229</span>&#160;                response( $.ui.autocomplete.filter(array, request.term) );</div>
<div class="line"><a name="l06230"></a><span class="lineno"> 6230</span>&#160;            };</div>
<div class="line"><a name="l06231"></a><span class="lineno"> 6231</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( typeof this.options.source === <span class="stringliteral">&quot;string&quot;</span> ) {</div>
<div class="line"><a name="l06232"></a><span class="lineno"> 6232</span>&#160;            url = this.options.source;</div>
<div class="line"><a name="l06233"></a><span class="lineno"> 6233</span>&#160;            this.source = <span class="keyword">function</span>( request, response ) {</div>
<div class="line"><a name="l06234"></a><span class="lineno"> 6234</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.xhr ) {</div>
<div class="line"><a name="l06235"></a><span class="lineno"> 6235</span>&#160;                    <span class="keyword">self</span>.xhr.abort();</div>
<div class="line"><a name="l06236"></a><span class="lineno"> 6236</span>&#160;                }</div>
<div class="line"><a name="l06237"></a><span class="lineno"> 6237</span>&#160;                <span class="keyword">self</span>.xhr = $.ajax({</div>
<div class="line"><a name="l06238"></a><span class="lineno"> 6238</span>&#160;                    url: url,</div>
<div class="line"><a name="l06239"></a><span class="lineno"> 6239</span>&#160;                    data: request,</div>
<div class="line"><a name="l06240"></a><span class="lineno"> 6240</span>&#160;                    dataType: <span class="stringliteral">&quot;json&quot;</span>,</div>
<div class="line"><a name="l06241"></a><span class="lineno"> 6241</span>&#160;                    success: <span class="keyword">function</span>( data, status ) {</div>
<div class="line"><a name="l06242"></a><span class="lineno"> 6242</span>&#160;                        response( data );</div>
<div class="line"><a name="l06243"></a><span class="lineno"> 6243</span>&#160;                    },</div>
<div class="line"><a name="l06244"></a><span class="lineno"> 6244</span>&#160;                    error: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06245"></a><span class="lineno"> 6245</span>&#160;                        response( [] );</div>
<div class="line"><a name="l06246"></a><span class="lineno"> 6246</span>&#160;                    }</div>
<div class="line"><a name="l06247"></a><span class="lineno"> 6247</span>&#160;                });</div>
<div class="line"><a name="l06248"></a><span class="lineno"> 6248</span>&#160;            };</div>
<div class="line"><a name="l06249"></a><span class="lineno"> 6249</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06250"></a><span class="lineno"> 6250</span>&#160;            this.source = this.options.source;</div>
<div class="line"><a name="l06251"></a><span class="lineno"> 6251</span>&#160;        }</div>
<div class="line"><a name="l06252"></a><span class="lineno"> 6252</span>&#160;    },</div>
<div class="line"><a name="l06253"></a><span class="lineno"> 6253</span>&#160;</div>
<div class="line"><a name="l06254"></a><span class="lineno"> 6254</span>&#160;    search: <span class="keyword">function</span>( value, event ) {</div>
<div class="line"><a name="l06255"></a><span class="lineno"> 6255</span>&#160;        value = value != null ? value : this.element.val();</div>
<div class="line"><a name="l06256"></a><span class="lineno"> 6256</span>&#160;</div>
<div class="line"><a name="l06257"></a><span class="lineno"> 6257</span>&#160;        <span class="comment">// always save the actual value, not the one passed as an argument</span></div>
<div class="line"><a name="l06258"></a><span class="lineno"> 6258</span>&#160;        this.term = this.element.val();</div>
<div class="line"><a name="l06259"></a><span class="lineno"> 6259</span>&#160;</div>
<div class="line"><a name="l06260"></a><span class="lineno"> 6260</span>&#160;        <span class="keywordflow">if</span> ( value.length &lt; <span class="keyword">this</span>.options.minLength ) {</div>
<div class="line"><a name="l06261"></a><span class="lineno"> 6261</span>&#160;            <span class="keywordflow">return</span> this.close( event );</div>
<div class="line"><a name="l06262"></a><span class="lineno"> 6262</span>&#160;        }</div>
<div class="line"><a name="l06263"></a><span class="lineno"> 6263</span>&#160;</div>
<div class="line"><a name="l06264"></a><span class="lineno"> 6264</span>&#160;        clearTimeout( this.closing );</div>
<div class="line"><a name="l06265"></a><span class="lineno"> 6265</span>&#160;        <span class="keywordflow">if</span> ( this._trigger( <span class="stringliteral">&quot;search&quot;</span>, event ) === <span class="keyword">false</span> ) {</div>
<div class="line"><a name="l06266"></a><span class="lineno"> 6266</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06267"></a><span class="lineno"> 6267</span>&#160;        }</div>
<div class="line"><a name="l06268"></a><span class="lineno"> 6268</span>&#160;</div>
<div class="line"><a name="l06269"></a><span class="lineno"> 6269</span>&#160;        <span class="keywordflow">return</span> this._search( value );</div>
<div class="line"><a name="l06270"></a><span class="lineno"> 6270</span>&#160;    },</div>
<div class="line"><a name="l06271"></a><span class="lineno"> 6271</span>&#160;</div>
<div class="line"><a name="l06272"></a><span class="lineno"> 6272</span>&#160;    _search: <span class="keyword">function</span>( value ) {</div>
<div class="line"><a name="l06273"></a><span class="lineno"> 6273</span>&#160;        this.pending++;</div>
<div class="line"><a name="l06274"></a><span class="lineno"> 6274</span>&#160;        this.element.addClass( <span class="stringliteral">&quot;ui-autocomplete-loading&quot;</span> );</div>
<div class="line"><a name="l06275"></a><span class="lineno"> 6275</span>&#160;</div>
<div class="line"><a name="l06276"></a><span class="lineno"> 6276</span>&#160;        this.source( { term: value }, this._response() );</div>
<div class="line"><a name="l06277"></a><span class="lineno"> 6277</span>&#160;    },</div>
<div class="line"><a name="l06278"></a><span class="lineno"> 6278</span>&#160;</div>
<div class="line"><a name="l06279"></a><span class="lineno"> 6279</span>&#160;    _response: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06280"></a><span class="lineno"> 6280</span>&#160;        var that = <span class="keyword">this</span>,</div>
<div class="line"><a name="l06281"></a><span class="lineno"> 6281</span>&#160;            index = ++requestIndex;</div>
<div class="line"><a name="l06282"></a><span class="lineno"> 6282</span>&#160;</div>
<div class="line"><a name="l06283"></a><span class="lineno"> 6283</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">function</span>( content ) {</div>
<div class="line"><a name="l06284"></a><span class="lineno"> 6284</span>&#160;            <span class="keywordflow">if</span> ( index === requestIndex ) {</div>
<div class="line"><a name="l06285"></a><span class="lineno"> 6285</span>&#160;                that.__response( content );</div>
<div class="line"><a name="l06286"></a><span class="lineno"> 6286</span>&#160;            }</div>
<div class="line"><a name="l06287"></a><span class="lineno"> 6287</span>&#160;</div>
<div class="line"><a name="l06288"></a><span class="lineno"> 6288</span>&#160;            that.pending--;</div>
<div class="line"><a name="l06289"></a><span class="lineno"> 6289</span>&#160;            <span class="keywordflow">if</span> ( !that.pending ) {</div>
<div class="line"><a name="l06290"></a><span class="lineno"> 6290</span>&#160;                that.element.removeClass( <span class="stringliteral">&quot;ui-autocomplete-loading&quot;</span> );</div>
<div class="line"><a name="l06291"></a><span class="lineno"> 6291</span>&#160;            }</div>
<div class="line"><a name="l06292"></a><span class="lineno"> 6292</span>&#160;        };</div>
<div class="line"><a name="l06293"></a><span class="lineno"> 6293</span>&#160;    },</div>
<div class="line"><a name="l06294"></a><span class="lineno"> 6294</span>&#160;</div>
<div class="line"><a name="l06295"></a><span class="lineno"> 6295</span>&#160;    __response: <span class="keyword">function</span>( content ) {</div>
<div class="line"><a name="l06296"></a><span class="lineno"> 6296</span>&#160;        <span class="keywordflow">if</span> ( !this.options.disabled &amp;&amp; content &amp;&amp; content.length ) {</div>
<div class="line"><a name="l06297"></a><span class="lineno"> 6297</span>&#160;            content = this._normalize( content );</div>
<div class="line"><a name="l06298"></a><span class="lineno"> 6298</span>&#160;            this._suggest( content );</div>
<div class="line"><a name="l06299"></a><span class="lineno"> 6299</span>&#160;            this._trigger( <span class="stringliteral">&quot;open&quot;</span> );</div>
<div class="line"><a name="l06300"></a><span class="lineno"> 6300</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06301"></a><span class="lineno"> 6301</span>&#160;            this.close();</div>
<div class="line"><a name="l06302"></a><span class="lineno"> 6302</span>&#160;        }</div>
<div class="line"><a name="l06303"></a><span class="lineno"> 6303</span>&#160;    },</div>
<div class="line"><a name="l06304"></a><span class="lineno"> 6304</span>&#160;</div>
<div class="line"><a name="l06305"></a><span class="lineno"> 6305</span>&#160;    close: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06306"></a><span class="lineno"> 6306</span>&#160;        clearTimeout( this.closing );</div>
<div class="line"><a name="l06307"></a><span class="lineno"> 6307</span>&#160;        <span class="keywordflow">if</span> ( this.menu.element.is(<span class="stringliteral">&quot;:visible&quot;</span>) ) {</div>
<div class="line"><a name="l06308"></a><span class="lineno"> 6308</span>&#160;            this.menu.element.hide();</div>
<div class="line"><a name="l06309"></a><span class="lineno"> 6309</span>&#160;            this.menu.deactivate();</div>
<div class="line"><a name="l06310"></a><span class="lineno"> 6310</span>&#160;            this._trigger( <span class="stringliteral">&quot;close&quot;</span>, event );</div>
<div class="line"><a name="l06311"></a><span class="lineno"> 6311</span>&#160;        }</div>
<div class="line"><a name="l06312"></a><span class="lineno"> 6312</span>&#160;    },</div>
<div class="line"><a name="l06313"></a><span class="lineno"> 6313</span>&#160;    </div>
<div class="line"><a name="l06314"></a><span class="lineno"> 6314</span>&#160;    _change: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06315"></a><span class="lineno"> 6315</span>&#160;        <span class="keywordflow">if</span> ( this.previous !== this.element.val() ) {</div>
<div class="line"><a name="l06316"></a><span class="lineno"> 6316</span>&#160;            this._trigger( <span class="stringliteral">&quot;change&quot;</span>, event, { item: this.selectedItem } );</div>
<div class="line"><a name="l06317"></a><span class="lineno"> 6317</span>&#160;        }</div>
<div class="line"><a name="l06318"></a><span class="lineno"> 6318</span>&#160;    },</div>
<div class="line"><a name="l06319"></a><span class="lineno"> 6319</span>&#160;</div>
<div class="line"><a name="l06320"></a><span class="lineno"> 6320</span>&#160;    _normalize: <span class="keyword">function</span>( items ) {</div>
<div class="line"><a name="l06321"></a><span class="lineno"> 6321</span>&#160;        <span class="comment">// assume all items have the right format when the first item is complete</span></div>
<div class="line"><a name="l06322"></a><span class="lineno"> 6322</span>&#160;        <span class="keywordflow">if</span> ( items.length &amp;&amp; items[0].label &amp;&amp; items[0].value ) {</div>
<div class="line"><a name="l06323"></a><span class="lineno"> 6323</span>&#160;            <span class="keywordflow">return</span> items;</div>
<div class="line"><a name="l06324"></a><span class="lineno"> 6324</span>&#160;        }</div>
<div class="line"><a name="l06325"></a><span class="lineno"> 6325</span>&#160;        <span class="keywordflow">return</span> $.map( items, <span class="keyword">function</span>(item) {</div>
<div class="line"><a name="l06326"></a><span class="lineno"> 6326</span>&#160;            <span class="keywordflow">if</span> ( typeof item === <span class="stringliteral">&quot;string&quot;</span> ) {</div>
<div class="line"><a name="l06327"></a><span class="lineno"> 6327</span>&#160;                <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l06328"></a><span class="lineno"> 6328</span>&#160;                    label: item,</div>
<div class="line"><a name="l06329"></a><span class="lineno"> 6329</span>&#160;                    value: item</div>
<div class="line"><a name="l06330"></a><span class="lineno"> 6330</span>&#160;                };</div>
<div class="line"><a name="l06331"></a><span class="lineno"> 6331</span>&#160;            }</div>
<div class="line"><a name="l06332"></a><span class="lineno"> 6332</span>&#160;            <span class="keywordflow">return</span> $.extend({</div>
<div class="line"><a name="l06333"></a><span class="lineno"> 6333</span>&#160;                label: item.label || item.value,</div>
<div class="line"><a name="l06334"></a><span class="lineno"> 6334</span>&#160;                value: item.value || item.label</div>
<div class="line"><a name="l06335"></a><span class="lineno"> 6335</span>&#160;            }, item );</div>
<div class="line"><a name="l06336"></a><span class="lineno"> 6336</span>&#160;        });</div>
<div class="line"><a name="l06337"></a><span class="lineno"> 6337</span>&#160;    },</div>
<div class="line"><a name="l06338"></a><span class="lineno"> 6338</span>&#160;</div>
<div class="line"><a name="l06339"></a><span class="lineno"> 6339</span>&#160;    _suggest: <span class="keyword">function</span>( items ) {</div>
<div class="line"><a name="l06340"></a><span class="lineno"> 6340</span>&#160;        var ul = this.menu.element</div>
<div class="line"><a name="l06341"></a><span class="lineno"> 6341</span>&#160;            .empty()</div>
<div class="line"><a name="l06342"></a><span class="lineno"> 6342</span>&#160;            .zIndex( this.element.zIndex() + 1 );</div>
<div class="line"><a name="l06343"></a><span class="lineno"> 6343</span>&#160;        this._renderMenu( ul, items );</div>
<div class="line"><a name="l06344"></a><span class="lineno"> 6344</span>&#160;        <span class="comment">// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate</span></div>
<div class="line"><a name="l06345"></a><span class="lineno"> 6345</span>&#160;        this.menu.deactivate();</div>
<div class="line"><a name="l06346"></a><span class="lineno"> 6346</span>&#160;        this.menu.refresh();</div>
<div class="line"><a name="l06347"></a><span class="lineno"> 6347</span>&#160;</div>
<div class="line"><a name="l06348"></a><span class="lineno"> 6348</span>&#160;        <span class="comment">// size and position menu</span></div>
<div class="line"><a name="l06349"></a><span class="lineno"> 6349</span>&#160;        ul.show();</div>
<div class="line"><a name="l06350"></a><span class="lineno"> 6350</span>&#160;        this._resizeMenu();</div>
<div class="line"><a name="l06351"></a><span class="lineno"> 6351</span>&#160;        ul.position( $.extend({</div>
<div class="line"><a name="l06352"></a><span class="lineno"> 6352</span>&#160;            of: this.element</div>
<div class="line"><a name="l06353"></a><span class="lineno"> 6353</span>&#160;        }, this.options.position ));</div>
<div class="line"><a name="l06354"></a><span class="lineno"> 6354</span>&#160;</div>
<div class="line"><a name="l06355"></a><span class="lineno"> 6355</span>&#160;        <span class="keywordflow">if</span> ( this.options.autoFocus ) {</div>
<div class="line"><a name="l06356"></a><span class="lineno"> 6356</span>&#160;            this.menu.next( <span class="keyword">new</span> $.Event(<span class="stringliteral">&quot;mouseover&quot;</span>) );</div>
<div class="line"><a name="l06357"></a><span class="lineno"> 6357</span>&#160;        }</div>
<div class="line"><a name="l06358"></a><span class="lineno"> 6358</span>&#160;    },</div>
<div class="line"><a name="l06359"></a><span class="lineno"> 6359</span>&#160;</div>
<div class="line"><a name="l06360"></a><span class="lineno"> 6360</span>&#160;    _resizeMenu: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06361"></a><span class="lineno"> 6361</span>&#160;        var ul = this.menu.element;</div>
<div class="line"><a name="l06362"></a><span class="lineno"> 6362</span>&#160;        ul.outerWidth( Math.max(</div>
<div class="line"><a name="l06363"></a><span class="lineno"> 6363</span>&#160;            <span class="comment">// Firefox wraps long text (possibly a rounding bug)</span></div>
<div class="line"><a name="l06364"></a><span class="lineno"> 6364</span>&#160;            <span class="comment">// so we add 1px to avoid the wrapping (#7513)</span></div>
<div class="line"><a name="l06365"></a><span class="lineno"> 6365</span>&#160;            ul.width( <span class="stringliteral">&quot;&quot;</span> ).outerWidth() + 1,</div>
<div class="line"><a name="l06366"></a><span class="lineno"> 6366</span>&#160;            this.element.outerWidth()</div>
<div class="line"><a name="l06367"></a><span class="lineno"> 6367</span>&#160;        ) );</div>
<div class="line"><a name="l06368"></a><span class="lineno"> 6368</span>&#160;    },</div>
<div class="line"><a name="l06369"></a><span class="lineno"> 6369</span>&#160;</div>
<div class="line"><a name="l06370"></a><span class="lineno"> 6370</span>&#160;    _renderMenu: <span class="keyword">function</span>( ul, items ) {</div>
<div class="line"><a name="l06371"></a><span class="lineno"> 6371</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l06372"></a><span class="lineno"> 6372</span>&#160;        $.each( items, <span class="keyword">function</span>( index, item ) {</div>
<div class="line"><a name="l06373"></a><span class="lineno"> 6373</span>&#160;            <span class="keyword">self</span>._renderItem( ul, item );</div>
<div class="line"><a name="l06374"></a><span class="lineno"> 6374</span>&#160;        });</div>
<div class="line"><a name="l06375"></a><span class="lineno"> 6375</span>&#160;    },</div>
<div class="line"><a name="l06376"></a><span class="lineno"> 6376</span>&#160;</div>
<div class="line"><a name="l06377"></a><span class="lineno"> 6377</span>&#160;    _renderItem: <span class="keyword">function</span>( ul, item) {</div>
<div class="line"><a name="l06378"></a><span class="lineno"> 6378</span>&#160;        <span class="keywordflow">return</span> $( <span class="stringliteral">&quot;&lt;li&gt;&lt;/li&gt;&quot;</span> )</div>
<div class="line"><a name="l06379"></a><span class="lineno"> 6379</span>&#160;            .data( <span class="stringliteral">&quot;item.autocomplete&quot;</span>, item )</div>
<div class="line"><a name="l06380"></a><span class="lineno"> 6380</span>&#160;            .append( $( <span class="stringliteral">&quot;&lt;a&gt;&lt;/a&gt;&quot;</span> ).text( item.label ) )</div>
<div class="line"><a name="l06381"></a><span class="lineno"> 6381</span>&#160;            .appendTo( ul );</div>
<div class="line"><a name="l06382"></a><span class="lineno"> 6382</span>&#160;    },</div>
<div class="line"><a name="l06383"></a><span class="lineno"> 6383</span>&#160;</div>
<div class="line"><a name="l06384"></a><span class="lineno"> 6384</span>&#160;    _move: <span class="keyword">function</span>( direction, event ) {</div>
<div class="line"><a name="l06385"></a><span class="lineno"> 6385</span>&#160;        <span class="keywordflow">if</span> ( !this.menu.element.is(<span class="stringliteral">&quot;:visible&quot;</span>) ) {</div>
<div class="line"><a name="l06386"></a><span class="lineno"> 6386</span>&#160;            this.search( null, event );</div>
<div class="line"><a name="l06387"></a><span class="lineno"> 6387</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06388"></a><span class="lineno"> 6388</span>&#160;        }</div>
<div class="line"><a name="l06389"></a><span class="lineno"> 6389</span>&#160;        <span class="keywordflow">if</span> ( this.menu.first() &amp;&amp; /^previous/.test(direction) ||</div>
<div class="line"><a name="l06390"></a><span class="lineno"> 6390</span>&#160;                this.menu.last() &amp;&amp; /^next/.test(direction) ) {</div>
<div class="line"><a name="l06391"></a><span class="lineno"> 6391</span>&#160;            this.element.val( this.term );</div>
<div class="line"><a name="l06392"></a><span class="lineno"> 6392</span>&#160;            this.menu.deactivate();</div>
<div class="line"><a name="l06393"></a><span class="lineno"> 6393</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06394"></a><span class="lineno"> 6394</span>&#160;        }</div>
<div class="line"><a name="l06395"></a><span class="lineno"> 6395</span>&#160;        this.menu[ direction ]( event );</div>
<div class="line"><a name="l06396"></a><span class="lineno"> 6396</span>&#160;    },</div>
<div class="line"><a name="l06397"></a><span class="lineno"> 6397</span>&#160;</div>
<div class="line"><a name="l06398"></a><span class="lineno"> 6398</span>&#160;    widget: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06399"></a><span class="lineno"> 6399</span>&#160;        <span class="keywordflow">return</span> this.menu.element;</div>
<div class="line"><a name="l06400"></a><span class="lineno"> 6400</span>&#160;    },</div>
<div class="line"><a name="l06401"></a><span class="lineno"> 6401</span>&#160;    _keyEvent: <span class="keyword">function</span>( keyEvent, event ) {</div>
<div class="line"><a name="l06402"></a><span class="lineno"> 6402</span>&#160;        <span class="keywordflow">if</span> ( !this.isMultiLine || this.menu.element.is( <span class="stringliteral">&quot;:visible&quot;</span> ) ) {</div>
<div class="line"><a name="l06403"></a><span class="lineno"> 6403</span>&#160;            this._move( keyEvent, event );</div>
<div class="line"><a name="l06404"></a><span class="lineno"> 6404</span>&#160;</div>
<div class="line"><a name="l06405"></a><span class="lineno"> 6405</span>&#160;            <span class="comment">// prevents moving cursor to beginning/end of the text field in some browsers</span></div>
<div class="line"><a name="l06406"></a><span class="lineno"> 6406</span>&#160;            <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l06407"></a><span class="lineno"> 6407</span>&#160;        }</div>
<div class="line"><a name="l06408"></a><span class="lineno"> 6408</span>&#160;    }</div>
<div class="line"><a name="l06409"></a><span class="lineno"> 6409</span>&#160;});</div>
<div class="line"><a name="l06410"></a><span class="lineno"> 6410</span>&#160;</div>
<div class="line"><a name="l06411"></a><span class="lineno"> 6411</span>&#160;$.extend( $.ui.autocomplete, {</div>
<div class="line"><a name="l06412"></a><span class="lineno"> 6412</span>&#160;    escapeRegex: <span class="keyword">function</span>( value ) {</div>
<div class="line"><a name="l06413"></a><span class="lineno"> 6413</span>&#160;        <span class="keywordflow">return</span> value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, <span class="stringliteral">&quot;\\$&amp;&quot;</span>);</div>
<div class="line"><a name="l06414"></a><span class="lineno"> 6414</span>&#160;    },</div>
<div class="line"><a name="l06415"></a><span class="lineno"> 6415</span>&#160;    filter: <span class="keyword">function</span>(array, term) {</div>
<div class="line"><a name="l06416"></a><span class="lineno"> 6416</span>&#160;        var matcher = <span class="keyword">new</span> RegExp( $.ui.autocomplete.escapeRegex(term), <span class="stringliteral">&quot;i&quot;</span> );</div>
<div class="line"><a name="l06417"></a><span class="lineno"> 6417</span>&#160;        <span class="keywordflow">return</span> $.grep( array, <span class="keyword">function</span>(value) {</div>
<div class="line"><a name="l06418"></a><span class="lineno"> 6418</span>&#160;            <span class="keywordflow">return</span> matcher.test( value.label || value.value || value );</div>
<div class="line"><a name="l06419"></a><span class="lineno"> 6419</span>&#160;        });</div>
<div class="line"><a name="l06420"></a><span class="lineno"> 6420</span>&#160;    }</div>
<div class="line"><a name="l06421"></a><span class="lineno"> 6421</span>&#160;});</div>
<div class="line"><a name="l06422"></a><span class="lineno"> 6422</span>&#160;</div>
<div class="line"><a name="l06423"></a><span class="lineno"> 6423</span>&#160;}( jQuery ));</div>
<div class="line"><a name="l06424"></a><span class="lineno"> 6424</span>&#160;</div>
<div class="line"><a name="l06425"></a><span class="lineno"> 6425</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l06426"></a><span class="lineno"> 6426</span>&#160;<span class="comment"> * jQuery UI Menu (not officially released)</span></div>
<div class="line"><a name="l06427"></a><span class="lineno"> 6427</span>&#160;<span class="comment"> * </span></div>
<div class="line"><a name="l06428"></a><span class="lineno"> 6428</span>&#160;<span class="comment"> * This widget isn&#39;t yet finished and the API is subject to change. We plan to finish</span></div>
<div class="line"><a name="l06429"></a><span class="lineno"> 6429</span>&#160;<span class="comment"> * it for the next release. You&#39;re welcome to give it a try anyway and give us feedback,</span></div>
<div class="line"><a name="l06430"></a><span class="lineno"> 6430</span>&#160;<span class="comment"> * as long as you&#39;re okay with migrating your code later on. We can help with that, too.</span></div>
<div class="line"><a name="l06431"></a><span class="lineno"> 6431</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l06432"></a><span class="lineno"> 6432</span>&#160;<span class="comment"> * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)</span></div>
<div class="line"><a name="l06433"></a><span class="lineno"> 6433</span>&#160;<span class="comment"> * Dual licensed under the MIT or GPL Version 2 licenses.</span></div>
<div class="line"><a name="l06434"></a><span class="lineno"> 6434</span>&#160;<span class="comment"> * http://jquery.org/license</span></div>
<div class="line"><a name="l06435"></a><span class="lineno"> 6435</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l06436"></a><span class="lineno"> 6436</span>&#160;<span class="comment"> * http://docs.jquery.com/UI/Menu</span></div>
<div class="line"><a name="l06437"></a><span class="lineno"> 6437</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l06438"></a><span class="lineno"> 6438</span>&#160;<span class="comment"> * Depends:</span></div>
<div class="line"><a name="l06439"></a><span class="lineno"> 6439</span>&#160;<span class="comment"> *  jquery.ui.core.js</span></div>
<div class="line"><a name="l06440"></a><span class="lineno"> 6440</span>&#160;<span class="comment"> *  jquery.ui.widget.js</span></div>
<div class="line"><a name="l06441"></a><span class="lineno"> 6441</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l06442"></a><span class="lineno"> 6442</span>&#160;(<span class="keyword">function</span>($) {</div>
<div class="line"><a name="l06443"></a><span class="lineno"> 6443</span>&#160;</div>
<div class="line"><a name="l06444"></a><span class="lineno"> 6444</span>&#160;$.widget(<span class="stringliteral">&quot;ui.menu&quot;</span>, {</div>
<div class="line"><a name="l06445"></a><span class="lineno"> 6445</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06446"></a><span class="lineno"> 6446</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l06447"></a><span class="lineno"> 6447</span>&#160;        this.element</div>
<div class="line"><a name="l06448"></a><span class="lineno"> 6448</span>&#160;            .addClass(<span class="stringliteral">&quot;ui-menu ui-widget ui-widget-content ui-corner-all&quot;</span>)</div>
<div class="line"><a name="l06449"></a><span class="lineno"> 6449</span>&#160;            .attr({</div>
<div class="line"><a name="l06450"></a><span class="lineno"> 6450</span>&#160;                role: <span class="stringliteral">&quot;listbox&quot;</span>,</div>
<div class="line"><a name="l06451"></a><span class="lineno"> 6451</span>&#160;                <span class="stringliteral">&quot;aria-activedescendant&quot;</span>: <span class="stringliteral">&quot;ui-active-menuitem&quot;</span></div>
<div class="line"><a name="l06452"></a><span class="lineno"> 6452</span>&#160;            })</div>
<div class="line"><a name="l06453"></a><span class="lineno"> 6453</span>&#160;            .click(<span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06454"></a><span class="lineno"> 6454</span>&#160;                <span class="keywordflow">if</span> ( !$( event.target ).closest( <span class="stringliteral">&quot;.ui-menu-item a&quot;</span> ).length ) {</div>
<div class="line"><a name="l06455"></a><span class="lineno"> 6455</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06456"></a><span class="lineno"> 6456</span>&#160;                }</div>
<div class="line"><a name="l06457"></a><span class="lineno"> 6457</span>&#160;                <span class="comment">// temporary</span></div>
<div class="line"><a name="l06458"></a><span class="lineno"> 6458</span>&#160;                <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l06459"></a><span class="lineno"> 6459</span>&#160;                <span class="keyword">self</span>.select( event );</div>
<div class="line"><a name="l06460"></a><span class="lineno"> 6460</span>&#160;            });</div>
<div class="line"><a name="l06461"></a><span class="lineno"> 6461</span>&#160;        this.refresh();</div>
<div class="line"><a name="l06462"></a><span class="lineno"> 6462</span>&#160;    },</div>
<div class="line"><a name="l06463"></a><span class="lineno"> 6463</span>&#160;    </div>
<div class="line"><a name="l06464"></a><span class="lineno"> 6464</span>&#160;    refresh: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06465"></a><span class="lineno"> 6465</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l06466"></a><span class="lineno"> 6466</span>&#160;</div>
<div class="line"><a name="l06467"></a><span class="lineno"> 6467</span>&#160;        <span class="comment">// don&#39;t refresh list items that are already adapted</span></div>
<div class="line"><a name="l06468"></a><span class="lineno"> 6468</span>&#160;        var items = this.element.children(<span class="stringliteral">&quot;li:not(.ui-menu-item):has(a)&quot;</span>)</div>
<div class="line"><a name="l06469"></a><span class="lineno"> 6469</span>&#160;            .addClass(<span class="stringliteral">&quot;ui-menu-item&quot;</span>)</div>
<div class="line"><a name="l06470"></a><span class="lineno"> 6470</span>&#160;            .attr(<span class="stringliteral">&quot;role&quot;</span>, <span class="stringliteral">&quot;menuitem&quot;</span>);</div>
<div class="line"><a name="l06471"></a><span class="lineno"> 6471</span>&#160;        </div>
<div class="line"><a name="l06472"></a><span class="lineno"> 6472</span>&#160;        items.children(<span class="stringliteral">&quot;a&quot;</span>)</div>
<div class="line"><a name="l06473"></a><span class="lineno"> 6473</span>&#160;            .addClass(<span class="stringliteral">&quot;ui-corner-all&quot;</span>)</div>
<div class="line"><a name="l06474"></a><span class="lineno"> 6474</span>&#160;            .attr(<span class="stringliteral">&quot;tabindex&quot;</span>, -1)</div>
<div class="line"><a name="l06475"></a><span class="lineno"> 6475</span>&#160;            <span class="comment">// mouseenter doesn&#39;t work with event delegation</span></div>
<div class="line"><a name="l06476"></a><span class="lineno"> 6476</span>&#160;            .mouseenter(<span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06477"></a><span class="lineno"> 6477</span>&#160;                <span class="keyword">self</span>.activate( event, $(<span class="keyword">this</span>).parent() );</div>
<div class="line"><a name="l06478"></a><span class="lineno"> 6478</span>&#160;            })</div>
<div class="line"><a name="l06479"></a><span class="lineno"> 6479</span>&#160;            .mouseleave(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06480"></a><span class="lineno"> 6480</span>&#160;                <span class="keyword">self</span>.deactivate();</div>
<div class="line"><a name="l06481"></a><span class="lineno"> 6481</span>&#160;            });</div>
<div class="line"><a name="l06482"></a><span class="lineno"> 6482</span>&#160;    },</div>
<div class="line"><a name="l06483"></a><span class="lineno"> 6483</span>&#160;</div>
<div class="line"><a name="l06484"></a><span class="lineno"> 6484</span>&#160;    activate: <span class="keyword">function</span>( event, item ) {</div>
<div class="line"><a name="l06485"></a><span class="lineno"> 6485</span>&#160;        this.deactivate();</div>
<div class="line"><a name="l06486"></a><span class="lineno"> 6486</span>&#160;        <span class="keywordflow">if</span> (this.hasScroll()) {</div>
<div class="line"><a name="l06487"></a><span class="lineno"> 6487</span>&#160;            var offset = item.offset().top - this.element.offset().top,</div>
<div class="line"><a name="l06488"></a><span class="lineno"> 6488</span>&#160;                scroll = this.element.scrollTop(),</div>
<div class="line"><a name="l06489"></a><span class="lineno"> 6489</span>&#160;                elementHeight = this.element.height();</div>
<div class="line"><a name="l06490"></a><span class="lineno"> 6490</span>&#160;            <span class="keywordflow">if</span> (offset &lt; 0) {</div>
<div class="line"><a name="l06491"></a><span class="lineno"> 6491</span>&#160;                this.element.scrollTop( scroll + offset);</div>
<div class="line"><a name="l06492"></a><span class="lineno"> 6492</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (offset &gt;= elementHeight) {</div>
<div class="line"><a name="l06493"></a><span class="lineno"> 6493</span>&#160;                this.element.scrollTop( scroll + offset - elementHeight + item.height());</div>
<div class="line"><a name="l06494"></a><span class="lineno"> 6494</span>&#160;            }</div>
<div class="line"><a name="l06495"></a><span class="lineno"> 6495</span>&#160;        }</div>
<div class="line"><a name="l06496"></a><span class="lineno"> 6496</span>&#160;        this.active = item.eq(0)</div>
<div class="line"><a name="l06497"></a><span class="lineno"> 6497</span>&#160;            .children(<span class="stringliteral">&quot;a&quot;</span>)</div>
<div class="line"><a name="l06498"></a><span class="lineno"> 6498</span>&#160;                .addClass(<span class="stringliteral">&quot;ui-state-hover&quot;</span>)</div>
<div class="line"><a name="l06499"></a><span class="lineno"> 6499</span>&#160;                .attr(<span class="stringliteral">&quot;id&quot;</span>, <span class="stringliteral">&quot;ui-active-menuitem&quot;</span>)</div>
<div class="line"><a name="l06500"></a><span class="lineno"> 6500</span>&#160;            .end();</div>
<div class="line"><a name="l06501"></a><span class="lineno"> 6501</span>&#160;        this._trigger(<span class="stringliteral">&quot;focus&quot;</span>, event, { item: item });</div>
<div class="line"><a name="l06502"></a><span class="lineno"> 6502</span>&#160;    },</div>
<div class="line"><a name="l06503"></a><span class="lineno"> 6503</span>&#160;</div>
<div class="line"><a name="l06504"></a><span class="lineno"> 6504</span>&#160;    deactivate: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06505"></a><span class="lineno"> 6505</span>&#160;        <span class="keywordflow">if</span> (!this.active) { <span class="keywordflow">return</span>; }</div>
<div class="line"><a name="l06506"></a><span class="lineno"> 6506</span>&#160;</div>
<div class="line"><a name="l06507"></a><span class="lineno"> 6507</span>&#160;        this.active.children(<span class="stringliteral">&quot;a&quot;</span>)</div>
<div class="line"><a name="l06508"></a><span class="lineno"> 6508</span>&#160;            .removeClass(<span class="stringliteral">&quot;ui-state-hover&quot;</span>)</div>
<div class="line"><a name="l06509"></a><span class="lineno"> 6509</span>&#160;            .removeAttr(<span class="stringliteral">&quot;id&quot;</span>);</div>
<div class="line"><a name="l06510"></a><span class="lineno"> 6510</span>&#160;        this._trigger(<span class="stringliteral">&quot;blur&quot;</span>);</div>
<div class="line"><a name="l06511"></a><span class="lineno"> 6511</span>&#160;        this.active = null;</div>
<div class="line"><a name="l06512"></a><span class="lineno"> 6512</span>&#160;    },</div>
<div class="line"><a name="l06513"></a><span class="lineno"> 6513</span>&#160;</div>
<div class="line"><a name="l06514"></a><span class="lineno"> 6514</span>&#160;    next: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l06515"></a><span class="lineno"> 6515</span>&#160;        this.move(<span class="stringliteral">&quot;next&quot;</span>, <span class="stringliteral">&quot;.ui-menu-item:first&quot;</span>, event);</div>
<div class="line"><a name="l06516"></a><span class="lineno"> 6516</span>&#160;    },</div>
<div class="line"><a name="l06517"></a><span class="lineno"> 6517</span>&#160;</div>
<div class="line"><a name="l06518"></a><span class="lineno"> 6518</span>&#160;    previous: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l06519"></a><span class="lineno"> 6519</span>&#160;        this.move(<span class="stringliteral">&quot;prev&quot;</span>, <span class="stringliteral">&quot;.ui-menu-item:last&quot;</span>, event);</div>
<div class="line"><a name="l06520"></a><span class="lineno"> 6520</span>&#160;    },</div>
<div class="line"><a name="l06521"></a><span class="lineno"> 6521</span>&#160;</div>
<div class="line"><a name="l06522"></a><span class="lineno"> 6522</span>&#160;    first: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06523"></a><span class="lineno"> 6523</span>&#160;        <span class="keywordflow">return</span> this.active &amp;&amp; !this.active.prevAll(<span class="stringliteral">&quot;.ui-menu-item&quot;</span>).length;</div>
<div class="line"><a name="l06524"></a><span class="lineno"> 6524</span>&#160;    },</div>
<div class="line"><a name="l06525"></a><span class="lineno"> 6525</span>&#160;</div>
<div class="line"><a name="l06526"></a><span class="lineno"> 6526</span>&#160;    last: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06527"></a><span class="lineno"> 6527</span>&#160;        <span class="keywordflow">return</span> this.active &amp;&amp; !this.active.nextAll(<span class="stringliteral">&quot;.ui-menu-item&quot;</span>).length;</div>
<div class="line"><a name="l06528"></a><span class="lineno"> 6528</span>&#160;    },</div>
<div class="line"><a name="l06529"></a><span class="lineno"> 6529</span>&#160;</div>
<div class="line"><a name="l06530"></a><span class="lineno"> 6530</span>&#160;    move: <span class="keyword">function</span>(direction, edge, event) {</div>
<div class="line"><a name="l06531"></a><span class="lineno"> 6531</span>&#160;        <span class="keywordflow">if</span> (!this.active) {</div>
<div class="line"><a name="l06532"></a><span class="lineno"> 6532</span>&#160;            this.activate(event, this.element.children(edge));</div>
<div class="line"><a name="l06533"></a><span class="lineno"> 6533</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06534"></a><span class="lineno"> 6534</span>&#160;        }</div>
<div class="line"><a name="l06535"></a><span class="lineno"> 6535</span>&#160;        var next = this.active[direction + <span class="stringliteral">&quot;All&quot;</span>](<span class="stringliteral">&quot;.ui-menu-item&quot;</span>).eq(0);</div>
<div class="line"><a name="l06536"></a><span class="lineno"> 6536</span>&#160;        <span class="keywordflow">if</span> (next.length) {</div>
<div class="line"><a name="l06537"></a><span class="lineno"> 6537</span>&#160;            this.activate(event, next);</div>
<div class="line"><a name="l06538"></a><span class="lineno"> 6538</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06539"></a><span class="lineno"> 6539</span>&#160;            this.activate(event, this.element.children(edge));</div>
<div class="line"><a name="l06540"></a><span class="lineno"> 6540</span>&#160;        }</div>
<div class="line"><a name="l06541"></a><span class="lineno"> 6541</span>&#160;    },</div>
<div class="line"><a name="l06542"></a><span class="lineno"> 6542</span>&#160;</div>
<div class="line"><a name="l06543"></a><span class="lineno"> 6543</span>&#160;    <span class="comment">// TODO merge with previousPage</span></div>
<div class="line"><a name="l06544"></a><span class="lineno"> 6544</span>&#160;    nextPage: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l06545"></a><span class="lineno"> 6545</span>&#160;        <span class="keywordflow">if</span> (this.hasScroll()) {</div>
<div class="line"><a name="l06546"></a><span class="lineno"> 6546</span>&#160;            <span class="comment">// TODO merge with no-scroll-else</span></div>
<div class="line"><a name="l06547"></a><span class="lineno"> 6547</span>&#160;            <span class="keywordflow">if</span> (!this.active || this.last()) {</div>
<div class="line"><a name="l06548"></a><span class="lineno"> 6548</span>&#160;                this.activate(event, this.element.children(<span class="stringliteral">&quot;.ui-menu-item:first&quot;</span>));</div>
<div class="line"><a name="l06549"></a><span class="lineno"> 6549</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06550"></a><span class="lineno"> 6550</span>&#160;            }</div>
<div class="line"><a name="l06551"></a><span class="lineno"> 6551</span>&#160;            var base = this.active.offset().top,</div>
<div class="line"><a name="l06552"></a><span class="lineno"> 6552</span>&#160;                height = this.element.height(),</div>
<div class="line"><a name="l06553"></a><span class="lineno"> 6553</span>&#160;                result = this.element.children(<span class="stringliteral">&quot;.ui-menu-item&quot;</span>).filter(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06554"></a><span class="lineno"> 6554</span>&#160;                    var close = $(<span class="keyword">this</span>).offset().top - base - height + $(<span class="keyword">this</span>).height();</div>
<div class="line"><a name="l06555"></a><span class="lineno"> 6555</span>&#160;                    <span class="comment">// TODO improve approximation</span></div>
<div class="line"><a name="l06556"></a><span class="lineno"> 6556</span>&#160;                    <span class="keywordflow">return</span> close &lt; 10 &amp;&amp; close &gt; -10;</div>
<div class="line"><a name="l06557"></a><span class="lineno"> 6557</span>&#160;                });</div>
<div class="line"><a name="l06558"></a><span class="lineno"> 6558</span>&#160;</div>
<div class="line"><a name="l06559"></a><span class="lineno"> 6559</span>&#160;            <span class="comment">// TODO try to catch this earlier when scrollTop indicates the last page anyway</span></div>
<div class="line"><a name="l06560"></a><span class="lineno"> 6560</span>&#160;            <span class="keywordflow">if</span> (!result.length) {</div>
<div class="line"><a name="l06561"></a><span class="lineno"> 6561</span>&#160;                result = this.element.children(<span class="stringliteral">&quot;.ui-menu-item:last&quot;</span>);</div>
<div class="line"><a name="l06562"></a><span class="lineno"> 6562</span>&#160;            }</div>
<div class="line"><a name="l06563"></a><span class="lineno"> 6563</span>&#160;            this.activate(event, result);</div>
<div class="line"><a name="l06564"></a><span class="lineno"> 6564</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06565"></a><span class="lineno"> 6565</span>&#160;            this.activate(event, this.element.children(<span class="stringliteral">&quot;.ui-menu-item&quot;</span>)</div>
<div class="line"><a name="l06566"></a><span class="lineno"> 6566</span>&#160;                .filter(!this.active || this.last() ? <span class="stringliteral">&quot;:first&quot;</span> : <span class="stringliteral">&quot;:last&quot;</span>));</div>
<div class="line"><a name="l06567"></a><span class="lineno"> 6567</span>&#160;        }</div>
<div class="line"><a name="l06568"></a><span class="lineno"> 6568</span>&#160;    },</div>
<div class="line"><a name="l06569"></a><span class="lineno"> 6569</span>&#160;</div>
<div class="line"><a name="l06570"></a><span class="lineno"> 6570</span>&#160;    <span class="comment">// TODO merge with nextPage</span></div>
<div class="line"><a name="l06571"></a><span class="lineno"> 6571</span>&#160;    previousPage: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l06572"></a><span class="lineno"> 6572</span>&#160;        <span class="keywordflow">if</span> (this.hasScroll()) {</div>
<div class="line"><a name="l06573"></a><span class="lineno"> 6573</span>&#160;            <span class="comment">// TODO merge with no-scroll-else</span></div>
<div class="line"><a name="l06574"></a><span class="lineno"> 6574</span>&#160;            <span class="keywordflow">if</span> (!this.active || this.first()) {</div>
<div class="line"><a name="l06575"></a><span class="lineno"> 6575</span>&#160;                this.activate(event, this.element.children(<span class="stringliteral">&quot;.ui-menu-item:last&quot;</span>));</div>
<div class="line"><a name="l06576"></a><span class="lineno"> 6576</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06577"></a><span class="lineno"> 6577</span>&#160;            }</div>
<div class="line"><a name="l06578"></a><span class="lineno"> 6578</span>&#160;</div>
<div class="line"><a name="l06579"></a><span class="lineno"> 6579</span>&#160;            var base = this.active.offset().top,</div>
<div class="line"><a name="l06580"></a><span class="lineno"> 6580</span>&#160;                height = this.element.height(),</div>
<div class="line"><a name="l06581"></a><span class="lineno"> 6581</span>&#160;                result = this.element.children(<span class="stringliteral">&quot;.ui-menu-item&quot;</span>).filter(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06582"></a><span class="lineno"> 6582</span>&#160;                    var close = $(<span class="keyword">this</span>).offset().top - base + height - $(<span class="keyword">this</span>).height();</div>
<div class="line"><a name="l06583"></a><span class="lineno"> 6583</span>&#160;                    <span class="comment">// TODO improve approximation</span></div>
<div class="line"><a name="l06584"></a><span class="lineno"> 6584</span>&#160;                    <span class="keywordflow">return</span> close &lt; 10 &amp;&amp; close &gt; -10;</div>
<div class="line"><a name="l06585"></a><span class="lineno"> 6585</span>&#160;                });</div>
<div class="line"><a name="l06586"></a><span class="lineno"> 6586</span>&#160;</div>
<div class="line"><a name="l06587"></a><span class="lineno"> 6587</span>&#160;            <span class="comment">// TODO try to catch this earlier when scrollTop indicates the last page anyway</span></div>
<div class="line"><a name="l06588"></a><span class="lineno"> 6588</span>&#160;            <span class="keywordflow">if</span> (!result.length) {</div>
<div class="line"><a name="l06589"></a><span class="lineno"> 6589</span>&#160;                result = this.element.children(<span class="stringliteral">&quot;.ui-menu-item:first&quot;</span>);</div>
<div class="line"><a name="l06590"></a><span class="lineno"> 6590</span>&#160;            }</div>
<div class="line"><a name="l06591"></a><span class="lineno"> 6591</span>&#160;            this.activate(event, result);</div>
<div class="line"><a name="l06592"></a><span class="lineno"> 6592</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06593"></a><span class="lineno"> 6593</span>&#160;            this.activate(event, this.element.children(<span class="stringliteral">&quot;.ui-menu-item&quot;</span>)</div>
<div class="line"><a name="l06594"></a><span class="lineno"> 6594</span>&#160;                .filter(!this.active || this.first() ? <span class="stringliteral">&quot;:last&quot;</span> : <span class="stringliteral">&quot;:first&quot;</span>));</div>
<div class="line"><a name="l06595"></a><span class="lineno"> 6595</span>&#160;        }</div>
<div class="line"><a name="l06596"></a><span class="lineno"> 6596</span>&#160;    },</div>
<div class="line"><a name="l06597"></a><span class="lineno"> 6597</span>&#160;</div>
<div class="line"><a name="l06598"></a><span class="lineno"> 6598</span>&#160;    hasScroll: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06599"></a><span class="lineno"> 6599</span>&#160;        <span class="keywordflow">return</span> this.element.height() &lt; this.element[ $.fn.prop ? <span class="stringliteral">&quot;prop&quot;</span> : <span class="stringliteral">&quot;attr&quot;</span> ](<span class="stringliteral">&quot;scrollHeight&quot;</span>);</div>
<div class="line"><a name="l06600"></a><span class="lineno"> 6600</span>&#160;    },</div>
<div class="line"><a name="l06601"></a><span class="lineno"> 6601</span>&#160;</div>
<div class="line"><a name="l06602"></a><span class="lineno"> 6602</span>&#160;    select: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06603"></a><span class="lineno"> 6603</span>&#160;        this._trigger(<span class="stringliteral">&quot;selected&quot;</span>, event, { item: this.active });</div>
<div class="line"><a name="l06604"></a><span class="lineno"> 6604</span>&#160;    }</div>
<div class="line"><a name="l06605"></a><span class="lineno"> 6605</span>&#160;});</div>
<div class="line"><a name="l06606"></a><span class="lineno"> 6606</span>&#160;</div>
<div class="line"><a name="l06607"></a><span class="lineno"> 6607</span>&#160;}(jQuery));</div>
<div class="line"><a name="l06608"></a><span class="lineno"> 6608</span>&#160;</div>
<div class="line"><a name="l06609"></a><span class="lineno"> 6609</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l06610"></a><span class="lineno"> 6610</span>&#160;</div>
<div class="line"><a name="l06611"></a><span class="lineno"> 6611</span>&#160;var lastActive, startXPos, startYPos, clickDragged,</div>
<div class="line"><a name="l06612"></a><span class="lineno"> 6612</span>&#160;    baseClasses = <span class="stringliteral">&quot;ui-button ui-widget ui-state-default ui-corner-all&quot;</span>,</div>
<div class="line"><a name="l06613"></a><span class="lineno"> 6613</span>&#160;    stateClasses = <span class="stringliteral">&quot;ui-state-hover ui-state-active &quot;</span>,</div>
<div class="line"><a name="l06614"></a><span class="lineno"> 6614</span>&#160;    typeClasses = <span class="stringliteral">&quot;ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only&quot;</span>,</div>
<div class="line"><a name="l06615"></a><span class="lineno"> 6615</span>&#160;    formResetHandler = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06616"></a><span class="lineno"> 6616</span>&#160;        var buttons = $( this ).find( <span class="stringliteral">&quot;:ui-button&quot;</span> );</div>
<div class="line"><a name="l06617"></a><span class="lineno"> 6617</span>&#160;        setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06618"></a><span class="lineno"> 6618</span>&#160;            buttons.button( <span class="stringliteral">&quot;refresh&quot;</span> );</div>
<div class="line"><a name="l06619"></a><span class="lineno"> 6619</span>&#160;        }, 1 );</div>
<div class="line"><a name="l06620"></a><span class="lineno"> 6620</span>&#160;    },</div>
<div class="line"><a name="l06621"></a><span class="lineno"> 6621</span>&#160;    radioGroup = <span class="keyword">function</span>( radio ) {</div>
<div class="line"><a name="l06622"></a><span class="lineno"> 6622</span>&#160;        var name = radio.name,</div>
<div class="line"><a name="l06623"></a><span class="lineno"> 6623</span>&#160;            form = radio.form,</div>
<div class="line"><a name="l06624"></a><span class="lineno"> 6624</span>&#160;            radios = $( [] );</div>
<div class="line"><a name="l06625"></a><span class="lineno"> 6625</span>&#160;        <span class="keywordflow">if</span> ( name ) {</div>
<div class="line"><a name="l06626"></a><span class="lineno"> 6626</span>&#160;            <span class="keywordflow">if</span> ( form ) {</div>
<div class="line"><a name="l06627"></a><span class="lineno"> 6627</span>&#160;                radios = $( form ).find( <span class="stringliteral">&quot;[name=&#39;&quot;</span> + name + <span class="stringliteral">&quot;&#39;]&quot;</span> );</div>
<div class="line"><a name="l06628"></a><span class="lineno"> 6628</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06629"></a><span class="lineno"> 6629</span>&#160;                radios = $( <span class="stringliteral">&quot;[name=&#39;&quot;</span> + name + <span class="stringliteral">&quot;&#39;]&quot;</span>, radio.ownerDocument )</div>
<div class="line"><a name="l06630"></a><span class="lineno"> 6630</span>&#160;                    .filter(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06631"></a><span class="lineno"> 6631</span>&#160;                        <span class="keywordflow">return</span> !this.form;</div>
<div class="line"><a name="l06632"></a><span class="lineno"> 6632</span>&#160;                    });</div>
<div class="line"><a name="l06633"></a><span class="lineno"> 6633</span>&#160;            }</div>
<div class="line"><a name="l06634"></a><span class="lineno"> 6634</span>&#160;        }</div>
<div class="line"><a name="l06635"></a><span class="lineno"> 6635</span>&#160;        <span class="keywordflow">return</span> radios;</div>
<div class="line"><a name="l06636"></a><span class="lineno"> 6636</span>&#160;    };</div>
<div class="line"><a name="l06637"></a><span class="lineno"> 6637</span>&#160;</div>
<div class="line"><a name="l06638"></a><span class="lineno"> 6638</span>&#160;$.widget( <span class="stringliteral">&quot;ui.button&quot;</span>, {</div>
<div class="line"><a name="l06639"></a><span class="lineno"> 6639</span>&#160;    options: {</div>
<div class="line"><a name="l06640"></a><span class="lineno"> 6640</span>&#160;        disabled: null,</div>
<div class="line"><a name="l06641"></a><span class="lineno"> 6641</span>&#160;        text: <span class="keyword">true</span>,</div>
<div class="line"><a name="l06642"></a><span class="lineno"> 6642</span>&#160;        label: null,</div>
<div class="line"><a name="l06643"></a><span class="lineno"> 6643</span>&#160;        icons: {</div>
<div class="line"><a name="l06644"></a><span class="lineno"> 6644</span>&#160;            primary: null,</div>
<div class="line"><a name="l06645"></a><span class="lineno"> 6645</span>&#160;            secondary: null</div>
<div class="line"><a name="l06646"></a><span class="lineno"> 6646</span>&#160;        }</div>
<div class="line"><a name="l06647"></a><span class="lineno"> 6647</span>&#160;    },</div>
<div class="line"><a name="l06648"></a><span class="lineno"> 6648</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06649"></a><span class="lineno"> 6649</span>&#160;        this.element.closest( <span class="stringliteral">&quot;form&quot;</span> )</div>
<div class="line"><a name="l06650"></a><span class="lineno"> 6650</span>&#160;            .unbind( <span class="stringliteral">&quot;reset.button&quot;</span> )</div>
<div class="line"><a name="l06651"></a><span class="lineno"> 6651</span>&#160;            .bind( <span class="stringliteral">&quot;reset.button&quot;</span>, formResetHandler );</div>
<div class="line"><a name="l06652"></a><span class="lineno"> 6652</span>&#160;</div>
<div class="line"><a name="l06653"></a><span class="lineno"> 6653</span>&#160;        <span class="keywordflow">if</span> ( typeof this.options.disabled !== <span class="stringliteral">&quot;boolean&quot;</span> ) {</div>
<div class="line"><a name="l06654"></a><span class="lineno"> 6654</span>&#160;            this.options.disabled = !!this.element.propAttr( <span class="stringliteral">&quot;disabled&quot;</span> );</div>
<div class="line"><a name="l06655"></a><span class="lineno"> 6655</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06656"></a><span class="lineno"> 6656</span>&#160;            this.element.propAttr( <span class="stringliteral">&quot;disabled&quot;</span>, this.options.disabled );</div>
<div class="line"><a name="l06657"></a><span class="lineno"> 6657</span>&#160;        }</div>
<div class="line"><a name="l06658"></a><span class="lineno"> 6658</span>&#160;</div>
<div class="line"><a name="l06659"></a><span class="lineno"> 6659</span>&#160;        this._determineButtonType();</div>
<div class="line"><a name="l06660"></a><span class="lineno"> 6660</span>&#160;        this.hasTitle = !!this.buttonElement.attr( <span class="stringliteral">&quot;title&quot;</span> );</div>
<div class="line"><a name="l06661"></a><span class="lineno"> 6661</span>&#160;</div>
<div class="line"><a name="l06662"></a><span class="lineno"> 6662</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l06663"></a><span class="lineno"> 6663</span>&#160;            options = this.options,</div>
<div class="line"><a name="l06664"></a><span class="lineno"> 6664</span>&#160;            toggleButton = this.type === <span class="stringliteral">&quot;checkbox&quot;</span> || this.type === <span class="stringliteral">&quot;radio&quot;</span>,</div>
<div class="line"><a name="l06665"></a><span class="lineno"> 6665</span>&#160;            hoverClass = <span class="stringliteral">&quot;ui-state-hover&quot;</span> + ( !toggleButton ? <span class="stringliteral">&quot; ui-state-active&quot;</span> : <span class="stringliteral">&quot;&quot;</span> ),</div>
<div class="line"><a name="l06666"></a><span class="lineno"> 6666</span>&#160;            focusClass = <span class="stringliteral">&quot;ui-state-focus&quot;</span>;</div>
<div class="line"><a name="l06667"></a><span class="lineno"> 6667</span>&#160;</div>
<div class="line"><a name="l06668"></a><span class="lineno"> 6668</span>&#160;        <span class="keywordflow">if</span> ( options.label === null ) {</div>
<div class="line"><a name="l06669"></a><span class="lineno"> 6669</span>&#160;            options.label = this.buttonElement.html();</div>
<div class="line"><a name="l06670"></a><span class="lineno"> 6670</span>&#160;        }</div>
<div class="line"><a name="l06671"></a><span class="lineno"> 6671</span>&#160;</div>
<div class="line"><a name="l06672"></a><span class="lineno"> 6672</span>&#160;        this.buttonElement</div>
<div class="line"><a name="l06673"></a><span class="lineno"> 6673</span>&#160;            .addClass( baseClasses )</div>
<div class="line"><a name="l06674"></a><span class="lineno"> 6674</span>&#160;            .attr( <span class="stringliteral">&quot;role&quot;</span>, <span class="stringliteral">&quot;button&quot;</span> )</div>
<div class="line"><a name="l06675"></a><span class="lineno"> 6675</span>&#160;            .bind( <span class="stringliteral">&quot;mouseenter.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06676"></a><span class="lineno"> 6676</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06677"></a><span class="lineno"> 6677</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06678"></a><span class="lineno"> 6678</span>&#160;                }</div>
<div class="line"><a name="l06679"></a><span class="lineno"> 6679</span>&#160;                $( this ).addClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> );</div>
<div class="line"><a name="l06680"></a><span class="lineno"> 6680</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">this</span> === lastActive ) {</div>
<div class="line"><a name="l06681"></a><span class="lineno"> 6681</span>&#160;                    $( this ).addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06682"></a><span class="lineno"> 6682</span>&#160;                }</div>
<div class="line"><a name="l06683"></a><span class="lineno"> 6683</span>&#160;            })</div>
<div class="line"><a name="l06684"></a><span class="lineno"> 6684</span>&#160;            .bind( <span class="stringliteral">&quot;mouseleave.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06685"></a><span class="lineno"> 6685</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06686"></a><span class="lineno"> 6686</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06687"></a><span class="lineno"> 6687</span>&#160;                }</div>
<div class="line"><a name="l06688"></a><span class="lineno"> 6688</span>&#160;                $( this ).removeClass( hoverClass );</div>
<div class="line"><a name="l06689"></a><span class="lineno"> 6689</span>&#160;            })</div>
<div class="line"><a name="l06690"></a><span class="lineno"> 6690</span>&#160;            .bind( <span class="stringliteral">&quot;click.button&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06691"></a><span class="lineno"> 6691</span>&#160;                <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06692"></a><span class="lineno"> 6692</span>&#160;                    <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l06693"></a><span class="lineno"> 6693</span>&#160;                    <span class="keyword">event</span>.stopImmediatePropagation();</div>
<div class="line"><a name="l06694"></a><span class="lineno"> 6694</span>&#160;                }</div>
<div class="line"><a name="l06695"></a><span class="lineno"> 6695</span>&#160;            });</div>
<div class="line"><a name="l06696"></a><span class="lineno"> 6696</span>&#160;</div>
<div class="line"><a name="l06697"></a><span class="lineno"> 6697</span>&#160;        this.element</div>
<div class="line"><a name="l06698"></a><span class="lineno"> 6698</span>&#160;            .bind( <span class="stringliteral">&quot;focus.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06699"></a><span class="lineno"> 6699</span>&#160;                <span class="comment">// no need to check disabled, focus won&#39;t be triggered anyway</span></div>
<div class="line"><a name="l06700"></a><span class="lineno"> 6700</span>&#160;                <span class="keyword">self</span>.buttonElement.addClass( focusClass );</div>
<div class="line"><a name="l06701"></a><span class="lineno"> 6701</span>&#160;            })</div>
<div class="line"><a name="l06702"></a><span class="lineno"> 6702</span>&#160;            .bind( <span class="stringliteral">&quot;blur.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06703"></a><span class="lineno"> 6703</span>&#160;                <span class="keyword">self</span>.buttonElement.removeClass( focusClass );</div>
<div class="line"><a name="l06704"></a><span class="lineno"> 6704</span>&#160;            });</div>
<div class="line"><a name="l06705"></a><span class="lineno"> 6705</span>&#160;</div>
<div class="line"><a name="l06706"></a><span class="lineno"> 6706</span>&#160;        <span class="keywordflow">if</span> ( toggleButton ) {</div>
<div class="line"><a name="l06707"></a><span class="lineno"> 6707</span>&#160;            this.element.bind( <span class="stringliteral">&quot;change.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06708"></a><span class="lineno"> 6708</span>&#160;                <span class="keywordflow">if</span> ( clickDragged ) {</div>
<div class="line"><a name="l06709"></a><span class="lineno"> 6709</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06710"></a><span class="lineno"> 6710</span>&#160;                }</div>
<div class="line"><a name="l06711"></a><span class="lineno"> 6711</span>&#160;                <span class="keyword">self</span>.refresh();</div>
<div class="line"><a name="l06712"></a><span class="lineno"> 6712</span>&#160;            });</div>
<div class="line"><a name="l06713"></a><span class="lineno"> 6713</span>&#160;            <span class="comment">// if mouse moves between mousedown and mouseup (drag) set clickDragged flag</span></div>
<div class="line"><a name="l06714"></a><span class="lineno"> 6714</span>&#160;            <span class="comment">// prevents issue where button state changes but checkbox/radio checked state</span></div>
<div class="line"><a name="l06715"></a><span class="lineno"> 6715</span>&#160;            <span class="comment">// does not in Firefox (see ticket #6970)</span></div>
<div class="line"><a name="l06716"></a><span class="lineno"> 6716</span>&#160;            this.buttonElement</div>
<div class="line"><a name="l06717"></a><span class="lineno"> 6717</span>&#160;                .bind( <span class="stringliteral">&quot;mousedown.button&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06718"></a><span class="lineno"> 6718</span>&#160;                    <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06719"></a><span class="lineno"> 6719</span>&#160;                        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06720"></a><span class="lineno"> 6720</span>&#160;                    }</div>
<div class="line"><a name="l06721"></a><span class="lineno"> 6721</span>&#160;                    clickDragged = <span class="keyword">false</span>;</div>
<div class="line"><a name="l06722"></a><span class="lineno"> 6722</span>&#160;                    startXPos = <span class="keyword">event</span>.pageX;</div>
<div class="line"><a name="l06723"></a><span class="lineno"> 6723</span>&#160;                    startYPos = <span class="keyword">event</span>.pageY;</div>
<div class="line"><a name="l06724"></a><span class="lineno"> 6724</span>&#160;                })</div>
<div class="line"><a name="l06725"></a><span class="lineno"> 6725</span>&#160;                .bind( <span class="stringliteral">&quot;mouseup.button&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l06726"></a><span class="lineno"> 6726</span>&#160;                    <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06727"></a><span class="lineno"> 6727</span>&#160;                        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06728"></a><span class="lineno"> 6728</span>&#160;                    }</div>
<div class="line"><a name="l06729"></a><span class="lineno"> 6729</span>&#160;                    <span class="keywordflow">if</span> ( startXPos !== event.pageX || startYPos !== event.pageY ) {</div>
<div class="line"><a name="l06730"></a><span class="lineno"> 6730</span>&#160;                        clickDragged = <span class="keyword">true</span>;</div>
<div class="line"><a name="l06731"></a><span class="lineno"> 6731</span>&#160;                    }</div>
<div class="line"><a name="l06732"></a><span class="lineno"> 6732</span>&#160;            });</div>
<div class="line"><a name="l06733"></a><span class="lineno"> 6733</span>&#160;        }</div>
<div class="line"><a name="l06734"></a><span class="lineno"> 6734</span>&#160;</div>
<div class="line"><a name="l06735"></a><span class="lineno"> 6735</span>&#160;        <span class="keywordflow">if</span> ( this.type === <span class="stringliteral">&quot;checkbox&quot;</span> ) {</div>
<div class="line"><a name="l06736"></a><span class="lineno"> 6736</span>&#160;            this.buttonElement.bind( <span class="stringliteral">&quot;click.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06737"></a><span class="lineno"> 6737</span>&#160;                <span class="keywordflow">if</span> ( options.disabled || clickDragged ) {</div>
<div class="line"><a name="l06738"></a><span class="lineno"> 6738</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l06739"></a><span class="lineno"> 6739</span>&#160;                }</div>
<div class="line"><a name="l06740"></a><span class="lineno"> 6740</span>&#160;                $( this ).toggleClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06741"></a><span class="lineno"> 6741</span>&#160;                <span class="keyword">self</span>.buttonElement.attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="keyword">self</span>.element[0].checked );</div>
<div class="line"><a name="l06742"></a><span class="lineno"> 6742</span>&#160;            });</div>
<div class="line"><a name="l06743"></a><span class="lineno"> 6743</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( this.type === <span class="stringliteral">&quot;radio&quot;</span> ) {</div>
<div class="line"><a name="l06744"></a><span class="lineno"> 6744</span>&#160;            this.buttonElement.bind( <span class="stringliteral">&quot;click.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06745"></a><span class="lineno"> 6745</span>&#160;                <span class="keywordflow">if</span> ( options.disabled || clickDragged ) {</div>
<div class="line"><a name="l06746"></a><span class="lineno"> 6746</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l06747"></a><span class="lineno"> 6747</span>&#160;                }</div>
<div class="line"><a name="l06748"></a><span class="lineno"> 6748</span>&#160;                $( this ).addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06749"></a><span class="lineno"> 6749</span>&#160;                <span class="keyword">self</span>.buttonElement.attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="stringliteral">&quot;true&quot;</span> );</div>
<div class="line"><a name="l06750"></a><span class="lineno"> 6750</span>&#160;</div>
<div class="line"><a name="l06751"></a><span class="lineno"> 6751</span>&#160;                var radio = <span class="keyword">self</span>.element[ 0 ];</div>
<div class="line"><a name="l06752"></a><span class="lineno"> 6752</span>&#160;                radioGroup( radio )</div>
<div class="line"><a name="l06753"></a><span class="lineno"> 6753</span>&#160;                    .not( radio )</div>
<div class="line"><a name="l06754"></a><span class="lineno"> 6754</span>&#160;                    .map(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06755"></a><span class="lineno"> 6755</span>&#160;                        <span class="keywordflow">return</span> $( this ).button( <span class="stringliteral">&quot;widget&quot;</span> )[ 0 ];</div>
<div class="line"><a name="l06756"></a><span class="lineno"> 6756</span>&#160;                    })</div>
<div class="line"><a name="l06757"></a><span class="lineno"> 6757</span>&#160;                    .removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> )</div>
<div class="line"><a name="l06758"></a><span class="lineno"> 6758</span>&#160;                    .attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="stringliteral">&quot;false&quot;</span> );</div>
<div class="line"><a name="l06759"></a><span class="lineno"> 6759</span>&#160;            });</div>
<div class="line"><a name="l06760"></a><span class="lineno"> 6760</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06761"></a><span class="lineno"> 6761</span>&#160;            this.buttonElement</div>
<div class="line"><a name="l06762"></a><span class="lineno"> 6762</span>&#160;                .bind( <span class="stringliteral">&quot;mousedown.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06763"></a><span class="lineno"> 6763</span>&#160;                    <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06764"></a><span class="lineno"> 6764</span>&#160;                        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l06765"></a><span class="lineno"> 6765</span>&#160;                    }</div>
<div class="line"><a name="l06766"></a><span class="lineno"> 6766</span>&#160;                    $( this ).addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06767"></a><span class="lineno"> 6767</span>&#160;                    lastActive = <span class="keyword">this</span>;</div>
<div class="line"><a name="l06768"></a><span class="lineno"> 6768</span>&#160;                    $( document ).one( <span class="stringliteral">&quot;mouseup&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06769"></a><span class="lineno"> 6769</span>&#160;                        lastActive = null;</div>
<div class="line"><a name="l06770"></a><span class="lineno"> 6770</span>&#160;                    });</div>
<div class="line"><a name="l06771"></a><span class="lineno"> 6771</span>&#160;                })</div>
<div class="line"><a name="l06772"></a><span class="lineno"> 6772</span>&#160;                .bind( <span class="stringliteral">&quot;mouseup.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06773"></a><span class="lineno"> 6773</span>&#160;                    <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06774"></a><span class="lineno"> 6774</span>&#160;                        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l06775"></a><span class="lineno"> 6775</span>&#160;                    }</div>
<div class="line"><a name="l06776"></a><span class="lineno"> 6776</span>&#160;                    $( this ).removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06777"></a><span class="lineno"> 6777</span>&#160;                })</div>
<div class="line"><a name="l06778"></a><span class="lineno"> 6778</span>&#160;                .bind( <span class="stringliteral">&quot;keydown.button&quot;</span>, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l06779"></a><span class="lineno"> 6779</span>&#160;                    <span class="keywordflow">if</span> ( options.disabled ) {</div>
<div class="line"><a name="l06780"></a><span class="lineno"> 6780</span>&#160;                        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l06781"></a><span class="lineno"> 6781</span>&#160;                    }</div>
<div class="line"><a name="l06782"></a><span class="lineno"> 6782</span>&#160;                    <span class="keywordflow">if</span> ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {</div>
<div class="line"><a name="l06783"></a><span class="lineno"> 6783</span>&#160;                        $( this ).addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06784"></a><span class="lineno"> 6784</span>&#160;                    }</div>
<div class="line"><a name="l06785"></a><span class="lineno"> 6785</span>&#160;                })</div>
<div class="line"><a name="l06786"></a><span class="lineno"> 6786</span>&#160;                .bind( <span class="stringliteral">&quot;keyup.button&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06787"></a><span class="lineno"> 6787</span>&#160;                    $( this ).removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06788"></a><span class="lineno"> 6788</span>&#160;                });</div>
<div class="line"><a name="l06789"></a><span class="lineno"> 6789</span>&#160;</div>
<div class="line"><a name="l06790"></a><span class="lineno"> 6790</span>&#160;            <span class="keywordflow">if</span> ( this.buttonElement.is(<span class="stringliteral">&quot;a&quot;</span>) ) {</div>
<div class="line"><a name="l06791"></a><span class="lineno"> 6791</span>&#160;                this.buttonElement.keyup(<span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l06792"></a><span class="lineno"> 6792</span>&#160;                    <span class="keywordflow">if</span> ( event.keyCode === $.ui.keyCode.SPACE ) {</div>
<div class="line"><a name="l06793"></a><span class="lineno"> 6793</span>&#160;                        <span class="comment">// TODO pass through original event correctly (just as 2nd argument doesn&#39;t work)</span></div>
<div class="line"><a name="l06794"></a><span class="lineno"> 6794</span>&#160;                        $( <span class="keyword">this</span> ).click();</div>
<div class="line"><a name="l06795"></a><span class="lineno"> 6795</span>&#160;                    }</div>
<div class="line"><a name="l06796"></a><span class="lineno"> 6796</span>&#160;                });</div>
<div class="line"><a name="l06797"></a><span class="lineno"> 6797</span>&#160;            }</div>
<div class="line"><a name="l06798"></a><span class="lineno"> 6798</span>&#160;        }</div>
<div class="line"><a name="l06799"></a><span class="lineno"> 6799</span>&#160;</div>
<div class="line"><a name="l06800"></a><span class="lineno"> 6800</span>&#160;        <span class="comment">// TODO: pull out $.Widget&#39;s handling for the disabled option into</span></div>
<div class="line"><a name="l06801"></a><span class="lineno"> 6801</span>&#160;        <span class="comment">// $.Widget.prototype._setOptionDisabled so it&#39;s easy to proxy and can</span></div>
<div class="line"><a name="l06802"></a><span class="lineno"> 6802</span>&#160;        <span class="comment">// be overridden by individual plugins</span></div>
<div class="line"><a name="l06803"></a><span class="lineno"> 6803</span>&#160;        this._setOption( <span class="stringliteral">&quot;disabled&quot;</span>, options.disabled );</div>
<div class="line"><a name="l06804"></a><span class="lineno"> 6804</span>&#160;        this._resetButton();</div>
<div class="line"><a name="l06805"></a><span class="lineno"> 6805</span>&#160;    },</div>
<div class="line"><a name="l06806"></a><span class="lineno"> 6806</span>&#160;</div>
<div class="line"><a name="l06807"></a><span class="lineno"> 6807</span>&#160;    _determineButtonType: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06808"></a><span class="lineno"> 6808</span>&#160;</div>
<div class="line"><a name="l06809"></a><span class="lineno"> 6809</span>&#160;        <span class="keywordflow">if</span> ( this.element.is(<span class="stringliteral">&quot;:checkbox&quot;</span>) ) {</div>
<div class="line"><a name="l06810"></a><span class="lineno"> 6810</span>&#160;            this.type = <span class="stringliteral">&quot;checkbox&quot;</span>;</div>
<div class="line"><a name="l06811"></a><span class="lineno"> 6811</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( this.element.is(<span class="stringliteral">&quot;:radio&quot;</span>) ) {</div>
<div class="line"><a name="l06812"></a><span class="lineno"> 6812</span>&#160;            this.type = <span class="stringliteral">&quot;radio&quot;</span>;</div>
<div class="line"><a name="l06813"></a><span class="lineno"> 6813</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( this.element.is(<span class="stringliteral">&quot;input&quot;</span>) ) {</div>
<div class="line"><a name="l06814"></a><span class="lineno"> 6814</span>&#160;            this.type = <span class="stringliteral">&quot;input&quot;</span>;</div>
<div class="line"><a name="l06815"></a><span class="lineno"> 6815</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06816"></a><span class="lineno"> 6816</span>&#160;            this.type = <span class="stringliteral">&quot;button&quot;</span>;</div>
<div class="line"><a name="l06817"></a><span class="lineno"> 6817</span>&#160;        }</div>
<div class="line"><a name="l06818"></a><span class="lineno"> 6818</span>&#160;</div>
<div class="line"><a name="l06819"></a><span class="lineno"> 6819</span>&#160;        <span class="keywordflow">if</span> ( this.type === <span class="stringliteral">&quot;checkbox&quot;</span> || this.type === <span class="stringliteral">&quot;radio&quot;</span> ) {</div>
<div class="line"><a name="l06820"></a><span class="lineno"> 6820</span>&#160;            <span class="comment">// we don&#39;t search against the document in case the element</span></div>
<div class="line"><a name="l06821"></a><span class="lineno"> 6821</span>&#160;            <span class="comment">// is disconnected from the DOM</span></div>
<div class="line"><a name="l06822"></a><span class="lineno"> 6822</span>&#160;            var ancestor = this.element.parents().filter(<span class="stringliteral">&quot;:last&quot;</span>),</div>
<div class="line"><a name="l06823"></a><span class="lineno"> 6823</span>&#160;                labelSelector = <span class="stringliteral">&quot;label[for=&#39;&quot;</span> + this.element.attr(<span class="stringliteral">&quot;id&quot;</span>) + <span class="stringliteral">&quot;&#39;]&quot;</span>;</div>
<div class="line"><a name="l06824"></a><span class="lineno"> 6824</span>&#160;            this.buttonElement = ancestor.find( labelSelector );</div>
<div class="line"><a name="l06825"></a><span class="lineno"> 6825</span>&#160;            <span class="keywordflow">if</span> ( !this.buttonElement.length ) {</div>
<div class="line"><a name="l06826"></a><span class="lineno"> 6826</span>&#160;                ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();</div>
<div class="line"><a name="l06827"></a><span class="lineno"> 6827</span>&#160;                this.buttonElement = ancestor.filter( labelSelector );</div>
<div class="line"><a name="l06828"></a><span class="lineno"> 6828</span>&#160;                <span class="keywordflow">if</span> ( !this.buttonElement.length ) {</div>
<div class="line"><a name="l06829"></a><span class="lineno"> 6829</span>&#160;                    this.buttonElement = ancestor.find( labelSelector );</div>
<div class="line"><a name="l06830"></a><span class="lineno"> 6830</span>&#160;                }</div>
<div class="line"><a name="l06831"></a><span class="lineno"> 6831</span>&#160;            }</div>
<div class="line"><a name="l06832"></a><span class="lineno"> 6832</span>&#160;            this.element.addClass( <span class="stringliteral">&quot;ui-helper-hidden-accessible&quot;</span> );</div>
<div class="line"><a name="l06833"></a><span class="lineno"> 6833</span>&#160;</div>
<div class="line"><a name="l06834"></a><span class="lineno"> 6834</span>&#160;            var checked = this.element.is( <span class="stringliteral">&quot;:checked&quot;</span> );</div>
<div class="line"><a name="l06835"></a><span class="lineno"> 6835</span>&#160;            <span class="keywordflow">if</span> ( checked ) {</div>
<div class="line"><a name="l06836"></a><span class="lineno"> 6836</span>&#160;                this.buttonElement.addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l06837"></a><span class="lineno"> 6837</span>&#160;            }</div>
<div class="line"><a name="l06838"></a><span class="lineno"> 6838</span>&#160;            this.buttonElement.attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, checked );</div>
<div class="line"><a name="l06839"></a><span class="lineno"> 6839</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06840"></a><span class="lineno"> 6840</span>&#160;            this.buttonElement = this.element;</div>
<div class="line"><a name="l06841"></a><span class="lineno"> 6841</span>&#160;        }</div>
<div class="line"><a name="l06842"></a><span class="lineno"> 6842</span>&#160;    },</div>
<div class="line"><a name="l06843"></a><span class="lineno"> 6843</span>&#160;</div>
<div class="line"><a name="l06844"></a><span class="lineno"> 6844</span>&#160;    widget: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06845"></a><span class="lineno"> 6845</span>&#160;        <span class="keywordflow">return</span> this.buttonElement;</div>
<div class="line"><a name="l06846"></a><span class="lineno"> 6846</span>&#160;    },</div>
<div class="line"><a name="l06847"></a><span class="lineno"> 6847</span>&#160;</div>
<div class="line"><a name="l06848"></a><span class="lineno"> 6848</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06849"></a><span class="lineno"> 6849</span>&#160;        this.element</div>
<div class="line"><a name="l06850"></a><span class="lineno"> 6850</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-helper-hidden-accessible&quot;</span> );</div>
<div class="line"><a name="l06851"></a><span class="lineno"> 6851</span>&#160;        this.buttonElement</div>
<div class="line"><a name="l06852"></a><span class="lineno"> 6852</span>&#160;            .removeClass( baseClasses + <span class="stringliteral">&quot; &quot;</span> + stateClasses + <span class="stringliteral">&quot; &quot;</span> + typeClasses )</div>
<div class="line"><a name="l06853"></a><span class="lineno"> 6853</span>&#160;            .removeAttr( <span class="stringliteral">&quot;role&quot;</span> )</div>
<div class="line"><a name="l06854"></a><span class="lineno"> 6854</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-pressed&quot;</span> )</div>
<div class="line"><a name="l06855"></a><span class="lineno"> 6855</span>&#160;            .html( this.buttonElement.find(<span class="stringliteral">&quot;.ui-button-text&quot;</span>).html() );</div>
<div class="line"><a name="l06856"></a><span class="lineno"> 6856</span>&#160;</div>
<div class="line"><a name="l06857"></a><span class="lineno"> 6857</span>&#160;        <span class="keywordflow">if</span> ( !this.hasTitle ) {</div>
<div class="line"><a name="l06858"></a><span class="lineno"> 6858</span>&#160;            this.buttonElement.removeAttr( <span class="stringliteral">&quot;title&quot;</span> );</div>
<div class="line"><a name="l06859"></a><span class="lineno"> 6859</span>&#160;        }</div>
<div class="line"><a name="l06860"></a><span class="lineno"> 6860</span>&#160;</div>
<div class="line"><a name="l06861"></a><span class="lineno"> 6861</span>&#160;        $.Widget.prototype.destroy.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l06862"></a><span class="lineno"> 6862</span>&#160;    },</div>
<div class="line"><a name="l06863"></a><span class="lineno"> 6863</span>&#160;</div>
<div class="line"><a name="l06864"></a><span class="lineno"> 6864</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l06865"></a><span class="lineno"> 6865</span>&#160;        $.Widget.prototype._setOption.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l06866"></a><span class="lineno"> 6866</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;disabled&quot;</span> ) {</div>
<div class="line"><a name="l06867"></a><span class="lineno"> 6867</span>&#160;            <span class="keywordflow">if</span> ( value ) {</div>
<div class="line"><a name="l06868"></a><span class="lineno"> 6868</span>&#160;                this.element.propAttr( <span class="stringliteral">&quot;disabled&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l06869"></a><span class="lineno"> 6869</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06870"></a><span class="lineno"> 6870</span>&#160;                this.element.propAttr( <span class="stringliteral">&quot;disabled&quot;</span>, <span class="keyword">false</span> );</div>
<div class="line"><a name="l06871"></a><span class="lineno"> 6871</span>&#160;            }</div>
<div class="line"><a name="l06872"></a><span class="lineno"> 6872</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06873"></a><span class="lineno"> 6873</span>&#160;        }</div>
<div class="line"><a name="l06874"></a><span class="lineno"> 6874</span>&#160;        this._resetButton();</div>
<div class="line"><a name="l06875"></a><span class="lineno"> 6875</span>&#160;    },</div>
<div class="line"><a name="l06876"></a><span class="lineno"> 6876</span>&#160;</div>
<div class="line"><a name="l06877"></a><span class="lineno"> 6877</span>&#160;    refresh: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06878"></a><span class="lineno"> 6878</span>&#160;        var isDisabled = this.element.is( <span class="stringliteral">&quot;:disabled&quot;</span> );</div>
<div class="line"><a name="l06879"></a><span class="lineno"> 6879</span>&#160;        <span class="keywordflow">if</span> ( isDisabled !== this.options.disabled ) {</div>
<div class="line"><a name="l06880"></a><span class="lineno"> 6880</span>&#160;            this._setOption( <span class="stringliteral">&quot;disabled&quot;</span>, isDisabled );</div>
<div class="line"><a name="l06881"></a><span class="lineno"> 6881</span>&#160;        }</div>
<div class="line"><a name="l06882"></a><span class="lineno"> 6882</span>&#160;        <span class="keywordflow">if</span> ( this.type === <span class="stringliteral">&quot;radio&quot;</span> ) {</div>
<div class="line"><a name="l06883"></a><span class="lineno"> 6883</span>&#160;            radioGroup( this.element[0] ).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06884"></a><span class="lineno"> 6884</span>&#160;                <span class="keywordflow">if</span> ( $( <span class="keyword">this</span> ).is( <span class="stringliteral">&quot;:checked&quot;</span> ) ) {</div>
<div class="line"><a name="l06885"></a><span class="lineno"> 6885</span>&#160;                    $( this ).button( <span class="stringliteral">&quot;widget&quot;</span> )</div>
<div class="line"><a name="l06886"></a><span class="lineno"> 6886</span>&#160;                        .addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> )</div>
<div class="line"><a name="l06887"></a><span class="lineno"> 6887</span>&#160;                        .attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="stringliteral">&quot;true&quot;</span> );</div>
<div class="line"><a name="l06888"></a><span class="lineno"> 6888</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06889"></a><span class="lineno"> 6889</span>&#160;                    $( this ).button( <span class="stringliteral">&quot;widget&quot;</span> )</div>
<div class="line"><a name="l06890"></a><span class="lineno"> 6890</span>&#160;                        .removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> )</div>
<div class="line"><a name="l06891"></a><span class="lineno"> 6891</span>&#160;                        .attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="stringliteral">&quot;false&quot;</span> );</div>
<div class="line"><a name="l06892"></a><span class="lineno"> 6892</span>&#160;                }</div>
<div class="line"><a name="l06893"></a><span class="lineno"> 6893</span>&#160;            });</div>
<div class="line"><a name="l06894"></a><span class="lineno"> 6894</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( this.type === <span class="stringliteral">&quot;checkbox&quot;</span> ) {</div>
<div class="line"><a name="l06895"></a><span class="lineno"> 6895</span>&#160;            <span class="keywordflow">if</span> ( this.element.is( <span class="stringliteral">&quot;:checked&quot;</span> ) ) {</div>
<div class="line"><a name="l06896"></a><span class="lineno"> 6896</span>&#160;                this.buttonElement</div>
<div class="line"><a name="l06897"></a><span class="lineno"> 6897</span>&#160;                    .addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> )</div>
<div class="line"><a name="l06898"></a><span class="lineno"> 6898</span>&#160;                    .attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="stringliteral">&quot;true&quot;</span> );</div>
<div class="line"><a name="l06899"></a><span class="lineno"> 6899</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06900"></a><span class="lineno"> 6900</span>&#160;                this.buttonElement</div>
<div class="line"><a name="l06901"></a><span class="lineno"> 6901</span>&#160;                    .removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> )</div>
<div class="line"><a name="l06902"></a><span class="lineno"> 6902</span>&#160;                    .attr( <span class="stringliteral">&quot;aria-pressed&quot;</span>, <span class="stringliteral">&quot;false&quot;</span> );</div>
<div class="line"><a name="l06903"></a><span class="lineno"> 6903</span>&#160;            }</div>
<div class="line"><a name="l06904"></a><span class="lineno"> 6904</span>&#160;        }</div>
<div class="line"><a name="l06905"></a><span class="lineno"> 6905</span>&#160;    },</div>
<div class="line"><a name="l06906"></a><span class="lineno"> 6906</span>&#160;</div>
<div class="line"><a name="l06907"></a><span class="lineno"> 6907</span>&#160;    _resetButton: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06908"></a><span class="lineno"> 6908</span>&#160;        <span class="keywordflow">if</span> ( this.type === <span class="stringliteral">&quot;input&quot;</span> ) {</div>
<div class="line"><a name="l06909"></a><span class="lineno"> 6909</span>&#160;            <span class="keywordflow">if</span> ( this.options.label ) {</div>
<div class="line"><a name="l06910"></a><span class="lineno"> 6910</span>&#160;                this.element.val( this.options.label );</div>
<div class="line"><a name="l06911"></a><span class="lineno"> 6911</span>&#160;            }</div>
<div class="line"><a name="l06912"></a><span class="lineno"> 6912</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l06913"></a><span class="lineno"> 6913</span>&#160;        }</div>
<div class="line"><a name="l06914"></a><span class="lineno"> 6914</span>&#160;        var buttonElement = this.buttonElement.removeClass( typeClasses ),</div>
<div class="line"><a name="l06915"></a><span class="lineno"> 6915</span>&#160;            buttonText = $( <span class="stringliteral">&quot;&lt;span&gt;&lt;/span&gt;&quot;</span>, this.element[0].ownerDocument )</div>
<div class="line"><a name="l06916"></a><span class="lineno"> 6916</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-button-text&quot;</span> )</div>
<div class="line"><a name="l06917"></a><span class="lineno"> 6917</span>&#160;                .html( this.options.label )</div>
<div class="line"><a name="l06918"></a><span class="lineno"> 6918</span>&#160;                .appendTo( buttonElement.empty() )</div>
<div class="line"><a name="l06919"></a><span class="lineno"> 6919</span>&#160;                .text(),</div>
<div class="line"><a name="l06920"></a><span class="lineno"> 6920</span>&#160;            icons = this.options.icons,</div>
<div class="line"><a name="l06921"></a><span class="lineno"> 6921</span>&#160;            multipleIcons = icons.primary &amp;&amp; icons.secondary,</div>
<div class="line"><a name="l06922"></a><span class="lineno"> 6922</span>&#160;            buttonClasses = [];  </div>
<div class="line"><a name="l06923"></a><span class="lineno"> 6923</span>&#160;</div>
<div class="line"><a name="l06924"></a><span class="lineno"> 6924</span>&#160;        <span class="keywordflow">if</span> ( icons.primary || icons.secondary ) {</div>
<div class="line"><a name="l06925"></a><span class="lineno"> 6925</span>&#160;            <span class="keywordflow">if</span> ( this.options.text ) {</div>
<div class="line"><a name="l06926"></a><span class="lineno"> 6926</span>&#160;                buttonClasses.push( <span class="stringliteral">&quot;ui-button-text-icon&quot;</span> + ( multipleIcons ? <span class="stringliteral">&quot;s&quot;</span> : ( icons.primary ? <span class="stringliteral">&quot;-primary&quot;</span> : <span class="stringliteral">&quot;-secondary&quot;</span> ) ) );</div>
<div class="line"><a name="l06927"></a><span class="lineno"> 6927</span>&#160;            }</div>
<div class="line"><a name="l06928"></a><span class="lineno"> 6928</span>&#160;</div>
<div class="line"><a name="l06929"></a><span class="lineno"> 6929</span>&#160;            <span class="keywordflow">if</span> ( icons.primary ) {</div>
<div class="line"><a name="l06930"></a><span class="lineno"> 6930</span>&#160;                buttonElement.prepend( <span class="stringliteral">&quot;&lt;span class=&#39;ui-button-icon-primary ui-icon &quot;</span> + icons.primary + <span class="stringliteral">&quot;&#39;&gt;&lt;/span&gt;&quot;</span> );</div>
<div class="line"><a name="l06931"></a><span class="lineno"> 6931</span>&#160;            }</div>
<div class="line"><a name="l06932"></a><span class="lineno"> 6932</span>&#160;</div>
<div class="line"><a name="l06933"></a><span class="lineno"> 6933</span>&#160;            <span class="keywordflow">if</span> ( icons.secondary ) {</div>
<div class="line"><a name="l06934"></a><span class="lineno"> 6934</span>&#160;                buttonElement.append( <span class="stringliteral">&quot;&lt;span class=&#39;ui-button-icon-secondary ui-icon &quot;</span> + icons.secondary + <span class="stringliteral">&quot;&#39;&gt;&lt;/span&gt;&quot;</span> );</div>
<div class="line"><a name="l06935"></a><span class="lineno"> 6935</span>&#160;            }</div>
<div class="line"><a name="l06936"></a><span class="lineno"> 6936</span>&#160;</div>
<div class="line"><a name="l06937"></a><span class="lineno"> 6937</span>&#160;            <span class="keywordflow">if</span> ( !this.options.text ) {</div>
<div class="line"><a name="l06938"></a><span class="lineno"> 6938</span>&#160;                buttonClasses.push( multipleIcons ? <span class="stringliteral">&quot;ui-button-icons-only&quot;</span> : <span class="stringliteral">&quot;ui-button-icon-only&quot;</span> );</div>
<div class="line"><a name="l06939"></a><span class="lineno"> 6939</span>&#160;</div>
<div class="line"><a name="l06940"></a><span class="lineno"> 6940</span>&#160;                <span class="keywordflow">if</span> ( !this.hasTitle ) {</div>
<div class="line"><a name="l06941"></a><span class="lineno"> 6941</span>&#160;                    buttonElement.attr( <span class="stringliteral">&quot;title&quot;</span>, buttonText );</div>
<div class="line"><a name="l06942"></a><span class="lineno"> 6942</span>&#160;                }</div>
<div class="line"><a name="l06943"></a><span class="lineno"> 6943</span>&#160;            }</div>
<div class="line"><a name="l06944"></a><span class="lineno"> 6944</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l06945"></a><span class="lineno"> 6945</span>&#160;            buttonClasses.push( <span class="stringliteral">&quot;ui-button-text-only&quot;</span> );</div>
<div class="line"><a name="l06946"></a><span class="lineno"> 6946</span>&#160;        }</div>
<div class="line"><a name="l06947"></a><span class="lineno"> 6947</span>&#160;        buttonElement.addClass( buttonClasses.join( <span class="stringliteral">&quot; &quot;</span> ) );</div>
<div class="line"><a name="l06948"></a><span class="lineno"> 6948</span>&#160;    }</div>
<div class="line"><a name="l06949"></a><span class="lineno"> 6949</span>&#160;});</div>
<div class="line"><a name="l06950"></a><span class="lineno"> 6950</span>&#160;</div>
<div class="line"><a name="l06951"></a><span class="lineno"> 6951</span>&#160;$.widget( <span class="stringliteral">&quot;ui.buttonset&quot;</span>, {</div>
<div class="line"><a name="l06952"></a><span class="lineno"> 6952</span>&#160;    options: {</div>
<div class="line"><a name="l06953"></a><span class="lineno"> 6953</span>&#160;        items: <span class="stringliteral">&quot;:button, :submit, :reset, :checkbox, :radio, a, :data(button)&quot;</span></div>
<div class="line"><a name="l06954"></a><span class="lineno"> 6954</span>&#160;    },</div>
<div class="line"><a name="l06955"></a><span class="lineno"> 6955</span>&#160;</div>
<div class="line"><a name="l06956"></a><span class="lineno"> 6956</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06957"></a><span class="lineno"> 6957</span>&#160;        this.element.addClass( <span class="stringliteral">&quot;ui-buttonset&quot;</span> );</div>
<div class="line"><a name="l06958"></a><span class="lineno"> 6958</span>&#160;    },</div>
<div class="line"><a name="l06959"></a><span class="lineno"> 6959</span>&#160;    </div>
<div class="line"><a name="l06960"></a><span class="lineno"> 6960</span>&#160;    _init: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06961"></a><span class="lineno"> 6961</span>&#160;        this.refresh();</div>
<div class="line"><a name="l06962"></a><span class="lineno"> 6962</span>&#160;    },</div>
<div class="line"><a name="l06963"></a><span class="lineno"> 6963</span>&#160;</div>
<div class="line"><a name="l06964"></a><span class="lineno"> 6964</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l06965"></a><span class="lineno"> 6965</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;disabled&quot;</span> ) {</div>
<div class="line"><a name="l06966"></a><span class="lineno"> 6966</span>&#160;            this.buttons.button( <span class="stringliteral">&quot;option&quot;</span>, key, value );</div>
<div class="line"><a name="l06967"></a><span class="lineno"> 6967</span>&#160;        }</div>
<div class="line"><a name="l06968"></a><span class="lineno"> 6968</span>&#160;</div>
<div class="line"><a name="l06969"></a><span class="lineno"> 6969</span>&#160;        $.Widget.prototype._setOption.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l06970"></a><span class="lineno"> 6970</span>&#160;    },</div>
<div class="line"><a name="l06971"></a><span class="lineno"> 6971</span>&#160;    </div>
<div class="line"><a name="l06972"></a><span class="lineno"> 6972</span>&#160;    refresh: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06973"></a><span class="lineno"> 6973</span>&#160;        var rtl = this.element.css( <span class="stringliteral">&quot;direction&quot;</span> ) === <span class="stringliteral">&quot;rtl&quot;</span>;</div>
<div class="line"><a name="l06974"></a><span class="lineno"> 6974</span>&#160;        </div>
<div class="line"><a name="l06975"></a><span class="lineno"> 6975</span>&#160;        this.buttons = this.element.find( this.options.items )</div>
<div class="line"><a name="l06976"></a><span class="lineno"> 6976</span>&#160;            .filter( <span class="stringliteral">&quot;:ui-button&quot;</span> )</div>
<div class="line"><a name="l06977"></a><span class="lineno"> 6977</span>&#160;                .button( <span class="stringliteral">&quot;refresh&quot;</span> )</div>
<div class="line"><a name="l06978"></a><span class="lineno"> 6978</span>&#160;            .end()</div>
<div class="line"><a name="l06979"></a><span class="lineno"> 6979</span>&#160;            .not( <span class="stringliteral">&quot;:ui-button&quot;</span> )</div>
<div class="line"><a name="l06980"></a><span class="lineno"> 6980</span>&#160;                .button()</div>
<div class="line"><a name="l06981"></a><span class="lineno"> 6981</span>&#160;            .end()</div>
<div class="line"><a name="l06982"></a><span class="lineno"> 6982</span>&#160;            .map(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06983"></a><span class="lineno"> 6983</span>&#160;                <span class="keywordflow">return</span> $( this ).button( <span class="stringliteral">&quot;widget&quot;</span> )[ 0 ];</div>
<div class="line"><a name="l06984"></a><span class="lineno"> 6984</span>&#160;            })</div>
<div class="line"><a name="l06985"></a><span class="lineno"> 6985</span>&#160;                .removeClass( <span class="stringliteral">&quot;ui-corner-all ui-corner-left ui-corner-right&quot;</span> )</div>
<div class="line"><a name="l06986"></a><span class="lineno"> 6986</span>&#160;                .filter( <span class="stringliteral">&quot;:first&quot;</span> )</div>
<div class="line"><a name="l06987"></a><span class="lineno"> 6987</span>&#160;                    .addClass( rtl ? <span class="stringliteral">&quot;ui-corner-right&quot;</span> : <span class="stringliteral">&quot;ui-corner-left&quot;</span> )</div>
<div class="line"><a name="l06988"></a><span class="lineno"> 6988</span>&#160;                .end()</div>
<div class="line"><a name="l06989"></a><span class="lineno"> 6989</span>&#160;                .filter( <span class="stringliteral">&quot;:last&quot;</span> )</div>
<div class="line"><a name="l06990"></a><span class="lineno"> 6990</span>&#160;                    .addClass( rtl ? <span class="stringliteral">&quot;ui-corner-left&quot;</span> : <span class="stringliteral">&quot;ui-corner-right&quot;</span> )</div>
<div class="line"><a name="l06991"></a><span class="lineno"> 6991</span>&#160;                .end()</div>
<div class="line"><a name="l06992"></a><span class="lineno"> 6992</span>&#160;            .end();</div>
<div class="line"><a name="l06993"></a><span class="lineno"> 6993</span>&#160;    },</div>
<div class="line"><a name="l06994"></a><span class="lineno"> 6994</span>&#160;</div>
<div class="line"><a name="l06995"></a><span class="lineno"> 6995</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l06996"></a><span class="lineno"> 6996</span>&#160;        this.element.removeClass( <span class="stringliteral">&quot;ui-buttonset&quot;</span> );</div>
<div class="line"><a name="l06997"></a><span class="lineno"> 6997</span>&#160;        this.buttons</div>
<div class="line"><a name="l06998"></a><span class="lineno"> 6998</span>&#160;            .map(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l06999"></a><span class="lineno"> 6999</span>&#160;                <span class="keywordflow">return</span> $( this ).button( <span class="stringliteral">&quot;widget&quot;</span> )[ 0 ];</div>
<div class="line"><a name="l07000"></a><span class="lineno"> 7000</span>&#160;            })</div>
<div class="line"><a name="l07001"></a><span class="lineno"> 7001</span>&#160;                .removeClass( <span class="stringliteral">&quot;ui-corner-left ui-corner-right&quot;</span> )</div>
<div class="line"><a name="l07002"></a><span class="lineno"> 7002</span>&#160;            .end()</div>
<div class="line"><a name="l07003"></a><span class="lineno"> 7003</span>&#160;            .button( <span class="stringliteral">&quot;destroy&quot;</span> );</div>
<div class="line"><a name="l07004"></a><span class="lineno"> 7004</span>&#160;</div>
<div class="line"><a name="l07005"></a><span class="lineno"> 7005</span>&#160;        $.Widget.prototype.destroy.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l07006"></a><span class="lineno"> 7006</span>&#160;    }</div>
<div class="line"><a name="l07007"></a><span class="lineno"> 7007</span>&#160;});</div>
<div class="line"><a name="l07008"></a><span class="lineno"> 7008</span>&#160;</div>
<div class="line"><a name="l07009"></a><span class="lineno"> 7009</span>&#160;}( jQuery ) );</div>
<div class="line"><a name="l07010"></a><span class="lineno"> 7010</span>&#160;</div>
<div class="line"><a name="l07011"></a><span class="lineno"> 7011</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l07012"></a><span class="lineno"> 7012</span>&#160;</div>
<div class="line"><a name="l07013"></a><span class="lineno"> 7013</span>&#160;$.extend($.ui, { datepicker: { version: <span class="stringliteral">&quot;1.8.20&quot;</span> } });</div>
<div class="line"><a name="l07014"></a><span class="lineno"> 7014</span>&#160;</div>
<div class="line"><a name="l07015"></a><span class="lineno"> 7015</span>&#160;var PROP_NAME = <span class="stringliteral">&#39;datepicker&#39;</span>;</div>
<div class="line"><a name="l07016"></a><span class="lineno"> 7016</span>&#160;var dpuuid = <span class="keyword">new</span> Date().getTime();</div>
<div class="line"><a name="l07017"></a><span class="lineno"> 7017</span>&#160;var instActive;</div>
<div class="line"><a name="l07018"></a><span class="lineno"> 7018</span>&#160;</div>
<div class="line"><a name="l07019"></a><span class="lineno"> 7019</span>&#160;<span class="comment">/* Date picker manager.</span></div>
<div class="line"><a name="l07020"></a><span class="lineno"> 7020</span>&#160;<span class="comment">   Use the singleton instance of this class, $.datepicker, to interact with the date picker.</span></div>
<div class="line"><a name="l07021"></a><span class="lineno"> 7021</span>&#160;<span class="comment">   Settings for (groups of) date pickers are maintained in an instance object,</span></div>
<div class="line"><a name="l07022"></a><span class="lineno"> 7022</span>&#160;<span class="comment">   allowing multiple different settings on the same page. */</span></div>
<div class="line"><a name="l07023"></a><span class="lineno"> 7023</span>&#160;</div>
<div class="line"><a name="l07024"></a><span class="lineno"> 7024</span>&#160;<span class="keyword">function</span> Datepicker() {</div>
<div class="line"><a name="l07025"></a><span class="lineno"> 7025</span>&#160;    this.debug = <span class="keyword">false</span>; <span class="comment">// Change this to true to start debugging</span></div>
<div class="line"><a name="l07026"></a><span class="lineno"> 7026</span>&#160;    this._curInst = null; <span class="comment">// The current instance in use</span></div>
<div class="line"><a name="l07027"></a><span class="lineno"> 7027</span>&#160;    this._keyEvent = <span class="keyword">false</span>; <span class="comment">// If the last event was a key event</span></div>
<div class="line"><a name="l07028"></a><span class="lineno"> 7028</span>&#160;    this._disabledInputs = []; <span class="comment">// List of date picker inputs that have been disabled</span></div>
<div class="line"><a name="l07029"></a><span class="lineno"> 7029</span>&#160;    this._datepickerShowing = <span class="keyword">false</span>; <span class="comment">// True if the popup picker is showing , false if not</span></div>
<div class="line"><a name="l07030"></a><span class="lineno"> 7030</span>&#160;    this._inDialog = <span class="keyword">false</span>; <span class="comment">// True if showing within a &quot;dialog&quot;, false if not</span></div>
<div class="line"><a name="l07031"></a><span class="lineno"> 7031</span>&#160;    this._mainDivId = <span class="stringliteral">&#39;ui-datepicker-div&#39;</span>; <span class="comment">// The ID of the main datepicker division</span></div>
<div class="line"><a name="l07032"></a><span class="lineno"> 7032</span>&#160;    this._inlineClass = <span class="stringliteral">&#39;ui-datepicker-inline&#39;</span>; <span class="comment">// The name of the inline marker class</span></div>
<div class="line"><a name="l07033"></a><span class="lineno"> 7033</span>&#160;    this._appendClass = <span class="stringliteral">&#39;ui-datepicker-append&#39;</span>; <span class="comment">// The name of the append marker class</span></div>
<div class="line"><a name="l07034"></a><span class="lineno"> 7034</span>&#160;    this._triggerClass = <span class="stringliteral">&#39;ui-datepicker-trigger&#39;</span>; <span class="comment">// The name of the trigger marker class</span></div>
<div class="line"><a name="l07035"></a><span class="lineno"> 7035</span>&#160;    this._dialogClass = <span class="stringliteral">&#39;ui-datepicker-dialog&#39;</span>; <span class="comment">// The name of the dialog marker class</span></div>
<div class="line"><a name="l07036"></a><span class="lineno"> 7036</span>&#160;    this._disableClass = <span class="stringliteral">&#39;ui-datepicker-disabled&#39;</span>; <span class="comment">// The name of the disabled covering marker class</span></div>
<div class="line"><a name="l07037"></a><span class="lineno"> 7037</span>&#160;    this._unselectableClass = <span class="stringliteral">&#39;ui-datepicker-unselectable&#39;</span>; <span class="comment">// The name of the unselectable cell marker class</span></div>
<div class="line"><a name="l07038"></a><span class="lineno"> 7038</span>&#160;    this._currentClass = <span class="stringliteral">&#39;ui-datepicker-current-day&#39;</span>; <span class="comment">// The name of the current day marker class</span></div>
<div class="line"><a name="l07039"></a><span class="lineno"> 7039</span>&#160;    this._dayOverClass = <span class="stringliteral">&#39;ui-datepicker-days-cell-over&#39;</span>; <span class="comment">// The name of the day hover marker class</span></div>
<div class="line"><a name="l07040"></a><span class="lineno"> 7040</span>&#160;    this.regional = []; <span class="comment">// Available regional settings, indexed by language code</span></div>
<div class="line"><a name="l07041"></a><span class="lineno"> 7041</span>&#160;    this.regional[<span class="stringliteral">&#39;&#39;</span>] = { <span class="comment">// Default regional settings</span></div>
<div class="line"><a name="l07042"></a><span class="lineno"> 7042</span>&#160;        closeText: <span class="stringliteral">&#39;Done&#39;</span>, <span class="comment">// Display text for close link</span></div>
<div class="line"><a name="l07043"></a><span class="lineno"> 7043</span>&#160;        prevText: <span class="stringliteral">&#39;Prev&#39;</span>, <span class="comment">// Display text for previous month link</span></div>
<div class="line"><a name="l07044"></a><span class="lineno"> 7044</span>&#160;        nextText: <span class="stringliteral">&#39;Next&#39;</span>, <span class="comment">// Display text for next month link</span></div>
<div class="line"><a name="l07045"></a><span class="lineno"> 7045</span>&#160;        currentText: <span class="stringliteral">&#39;Today&#39;</span>, <span class="comment">// Display text for current month link</span></div>
<div class="line"><a name="l07046"></a><span class="lineno"> 7046</span>&#160;        monthNames: [<span class="stringliteral">&#39;January&#39;</span>,<span class="stringliteral">&#39;February&#39;</span>,<span class="stringliteral">&#39;March&#39;</span>,<span class="stringliteral">&#39;April&#39;</span>,<span class="stringliteral">&#39;May&#39;</span>,<span class="stringliteral">&#39;June&#39;</span>,</div>
<div class="line"><a name="l07047"></a><span class="lineno"> 7047</span>&#160;            <span class="stringliteral">&#39;July&#39;</span>,<span class="stringliteral">&#39;August&#39;</span>,<span class="stringliteral">&#39;September&#39;</span>,<span class="stringliteral">&#39;October&#39;</span>,<span class="stringliteral">&#39;November&#39;</span>,<span class="stringliteral">&#39;December&#39;</span>], <span class="comment">// Names of months for drop-down and formatting</span></div>
<div class="line"><a name="l07048"></a><span class="lineno"> 7048</span>&#160;        monthNamesShort: [<span class="stringliteral">&#39;Jan&#39;</span>, <span class="stringliteral">&#39;Feb&#39;</span>, <span class="stringliteral">&#39;Mar&#39;</span>, <span class="stringliteral">&#39;Apr&#39;</span>, <span class="stringliteral">&#39;May&#39;</span>, <span class="stringliteral">&#39;Jun&#39;</span>, <span class="stringliteral">&#39;Jul&#39;</span>, <span class="stringliteral">&#39;Aug&#39;</span>, <span class="stringliteral">&#39;Sep&#39;</span>, <span class="stringliteral">&#39;Oct&#39;</span>, <span class="stringliteral">&#39;Nov&#39;</span>, <span class="stringliteral">&#39;Dec&#39;</span>], <span class="comment">// For formatting</span></div>
<div class="line"><a name="l07049"></a><span class="lineno"> 7049</span>&#160;        dayNames: [<span class="stringliteral">&#39;Sunday&#39;</span>, <span class="stringliteral">&#39;Monday&#39;</span>, <span class="stringliteral">&#39;Tuesday&#39;</span>, <span class="stringliteral">&#39;Wednesday&#39;</span>, <span class="stringliteral">&#39;Thursday&#39;</span>, <span class="stringliteral">&#39;Friday&#39;</span>, <span class="stringliteral">&#39;Saturday&#39;</span>], <span class="comment">// For formatting</span></div>
<div class="line"><a name="l07050"></a><span class="lineno"> 7050</span>&#160;        dayNamesShort: [<span class="stringliteral">&#39;Sun&#39;</span>, <span class="stringliteral">&#39;Mon&#39;</span>, <span class="stringliteral">&#39;Tue&#39;</span>, <span class="stringliteral">&#39;Wed&#39;</span>, <span class="stringliteral">&#39;Thu&#39;</span>, <span class="stringliteral">&#39;Fri&#39;</span>, <span class="stringliteral">&#39;Sat&#39;</span>], <span class="comment">// For formatting</span></div>
<div class="line"><a name="l07051"></a><span class="lineno"> 7051</span>&#160;        dayNamesMin: [<span class="stringliteral">&#39;Su&#39;</span>,<span class="stringliteral">&#39;Mo&#39;</span>,<span class="stringliteral">&#39;Tu&#39;</span>,<span class="stringliteral">&#39;We&#39;</span>,<span class="stringliteral">&#39;Th&#39;</span>,<span class="stringliteral">&#39;Fr&#39;</span>,<span class="stringliteral">&#39;Sa&#39;</span>], <span class="comment">// Column headings for days starting at Sunday</span></div>
<div class="line"><a name="l07052"></a><span class="lineno"> 7052</span>&#160;        weekHeader: <span class="stringliteral">&#39;Wk&#39;</span>, <span class="comment">// Column header for week of the year</span></div>
<div class="line"><a name="l07053"></a><span class="lineno"> 7053</span>&#160;        dateFormat: <span class="stringliteral">&#39;mm/dd/yy&#39;</span>, <span class="comment">// See format options on parseDate</span></div>
<div class="line"><a name="l07054"></a><span class="lineno"> 7054</span>&#160;        firstDay: 0, <span class="comment">// The first day of the week, Sun = 0, Mon = 1, ...</span></div>
<div class="line"><a name="l07055"></a><span class="lineno"> 7055</span>&#160;        isRTL: <span class="keyword">false</span>, <span class="comment">// True if right-to-left language, false if left-to-right</span></div>
<div class="line"><a name="l07056"></a><span class="lineno"> 7056</span>&#160;        showMonthAfterYear: <span class="keyword">false</span>, <span class="comment">// True if the year select precedes month, false for month then year</span></div>
<div class="line"><a name="l07057"></a><span class="lineno"> 7057</span>&#160;        yearSuffix: <span class="stringliteral">&#39;&#39;</span> <span class="comment">// Additional text to append to the year in the month headers</span></div>
<div class="line"><a name="l07058"></a><span class="lineno"> 7058</span>&#160;    };</div>
<div class="line"><a name="l07059"></a><span class="lineno"> 7059</span>&#160;    this._defaults = { <span class="comment">// Global defaults for all the date picker instances</span></div>
<div class="line"><a name="l07060"></a><span class="lineno"> 7060</span>&#160;        showOn: <span class="stringliteral">&#39;focus&#39;</span>, <span class="comment">// &#39;focus&#39; for popup on focus,</span></div>
<div class="line"><a name="l07061"></a><span class="lineno"> 7061</span>&#160;            <span class="comment">// &#39;button&#39; for trigger button, or &#39;both&#39; for either</span></div>
<div class="line"><a name="l07062"></a><span class="lineno"> 7062</span>&#160;        showAnim: <span class="stringliteral">&#39;fadeIn&#39;</span>, <span class="comment">// Name of jQuery animation for popup</span></div>
<div class="line"><a name="l07063"></a><span class="lineno"> 7063</span>&#160;        showOptions: {}, <span class="comment">// Options for enhanced animations</span></div>
<div class="line"><a name="l07064"></a><span class="lineno"> 7064</span>&#160;        defaultDate: null, <span class="comment">// Used when field is blank: actual date,</span></div>
<div class="line"><a name="l07065"></a><span class="lineno"> 7065</span>&#160;            <span class="comment">// +/-number for offset from today, null for today</span></div>
<div class="line"><a name="l07066"></a><span class="lineno"> 7066</span>&#160;        appendText: <span class="stringliteral">&#39;&#39;</span>, <span class="comment">// Display text following the input box, e.g. showing the format</span></div>
<div class="line"><a name="l07067"></a><span class="lineno"> 7067</span>&#160;        buttonText: <span class="stringliteral">&#39;...&#39;</span>, <span class="comment">// Text for trigger button</span></div>
<div class="line"><a name="l07068"></a><span class="lineno"> 7068</span>&#160;        buttonImage: <span class="stringliteral">&#39;&#39;</span>, <span class="comment">// URL for trigger button image</span></div>
<div class="line"><a name="l07069"></a><span class="lineno"> 7069</span>&#160;        buttonImageOnly: <span class="keyword">false</span>, <span class="comment">// True if the image appears alone, false if it appears on a button</span></div>
<div class="line"><a name="l07070"></a><span class="lineno"> 7070</span>&#160;        hideIfNoPrevNext: <span class="keyword">false</span>, <span class="comment">// True to hide next/previous month links</span></div>
<div class="line"><a name="l07071"></a><span class="lineno"> 7071</span>&#160;            <span class="comment">// if not applicable, false to just disable them</span></div>
<div class="line"><a name="l07072"></a><span class="lineno"> 7072</span>&#160;        navigationAsDateFormat: <span class="keyword">false</span>, <span class="comment">// True if date formatting applied to prev/today/next links</span></div>
<div class="line"><a name="l07073"></a><span class="lineno"> 7073</span>&#160;        gotoCurrent: <span class="keyword">false</span>, <span class="comment">// True if today link goes back to current selection instead</span></div>
<div class="line"><a name="l07074"></a><span class="lineno"> 7074</span>&#160;        changeMonth: <span class="keyword">false</span>, <span class="comment">// True if month can be selected directly, false if only prev/next</span></div>
<div class="line"><a name="l07075"></a><span class="lineno"> 7075</span>&#160;        changeYear: <span class="keyword">false</span>, <span class="comment">// True if year can be selected directly, false if only prev/next</span></div>
<div class="line"><a name="l07076"></a><span class="lineno"> 7076</span>&#160;        yearRange: <span class="stringliteral">&#39;c-10:c+10&#39;</span>, <span class="comment">// Range of years to display in drop-down,</span></div>
<div class="line"><a name="l07077"></a><span class="lineno"> 7077</span>&#160;            <span class="comment">// either relative to today&#39;s year (-nn:+nn), relative to currently displayed year</span></div>
<div class="line"><a name="l07078"></a><span class="lineno"> 7078</span>&#160;            <span class="comment">// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)</span></div>
<div class="line"><a name="l07079"></a><span class="lineno"> 7079</span>&#160;        showOtherMonths: <span class="keyword">false</span>, <span class="comment">// True to show dates in other months, false to leave blank</span></div>
<div class="line"><a name="l07080"></a><span class="lineno"> 7080</span>&#160;        selectOtherMonths: <span class="keyword">false</span>, <span class="comment">// True to allow selection of dates in other months, false for unselectable</span></div>
<div class="line"><a name="l07081"></a><span class="lineno"> 7081</span>&#160;        showWeek: <span class="keyword">false</span>, <span class="comment">// True to show week of the year, false to not show it</span></div>
<div class="line"><a name="l07082"></a><span class="lineno"> 7082</span>&#160;        calculateWeek: this.iso8601Week, <span class="comment">// How to calculate the week of the year,</span></div>
<div class="line"><a name="l07083"></a><span class="lineno"> 7083</span>&#160;            <span class="comment">// takes a Date and returns the number of the week for it</span></div>
<div class="line"><a name="l07084"></a><span class="lineno"> 7084</span>&#160;        shortYearCutoff: <span class="stringliteral">&#39;+10&#39;</span>, <span class="comment">// Short year values &lt; this are in the current century,</span></div>
<div class="line"><a name="l07085"></a><span class="lineno"> 7085</span>&#160;            <span class="comment">// &gt; this are in the previous century,</span></div>
<div class="line"><a name="l07086"></a><span class="lineno"> 7086</span>&#160;            <span class="comment">// string value starting with &#39;+&#39; for current year + value</span></div>
<div class="line"><a name="l07087"></a><span class="lineno"> 7087</span>&#160;        minDate: null, <span class="comment">// The earliest selectable date, or null for no limit</span></div>
<div class="line"><a name="l07088"></a><span class="lineno"> 7088</span>&#160;        maxDate: null, <span class="comment">// The latest selectable date, or null for no limit</span></div>
<div class="line"><a name="l07089"></a><span class="lineno"> 7089</span>&#160;        duration: <span class="stringliteral">&#39;fast&#39;</span>, <span class="comment">// Duration of display/closure</span></div>
<div class="line"><a name="l07090"></a><span class="lineno"> 7090</span>&#160;        beforeShowDay: null, <span class="comment">// Function that takes a date and returns an array with</span></div>
<div class="line"><a name="l07091"></a><span class="lineno"> 7091</span>&#160;            <span class="comment">// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or &#39;&#39;,</span></div>
<div class="line"><a name="l07092"></a><span class="lineno"> 7092</span>&#160;            <span class="comment">// [2] = cell title (optional), e.g. $.datepicker.noWeekends</span></div>
<div class="line"><a name="l07093"></a><span class="lineno"> 7093</span>&#160;        beforeShow: null, <span class="comment">// Function that takes an input field and</span></div>
<div class="line"><a name="l07094"></a><span class="lineno"> 7094</span>&#160;            <span class="comment">// returns a set of custom settings for the date picker</span></div>
<div class="line"><a name="l07095"></a><span class="lineno"> 7095</span>&#160;        onSelect: null, <span class="comment">// Define a callback function when a date is selected</span></div>
<div class="line"><a name="l07096"></a><span class="lineno"> 7096</span>&#160;        onChangeMonthYear: null, <span class="comment">// Define a callback function when the month or year is changed</span></div>
<div class="line"><a name="l07097"></a><span class="lineno"> 7097</span>&#160;        onClose: null, <span class="comment">// Define a callback function when the datepicker is closed</span></div>
<div class="line"><a name="l07098"></a><span class="lineno"> 7098</span>&#160;        numberOfMonths: 1, <span class="comment">// Number of months to show at a time</span></div>
<div class="line"><a name="l07099"></a><span class="lineno"> 7099</span>&#160;        showCurrentAtPos: 0, <span class="comment">// The position in multipe months at which to show the current month (starting at 0)</span></div>
<div class="line"><a name="l07100"></a><span class="lineno"> 7100</span>&#160;        stepMonths: 1, <span class="comment">// Number of months to step back/forward</span></div>
<div class="line"><a name="l07101"></a><span class="lineno"> 7101</span>&#160;        stepBigMonths: 12, <span class="comment">// Number of months to step back/forward for the big links</span></div>
<div class="line"><a name="l07102"></a><span class="lineno"> 7102</span>&#160;        altField: <span class="stringliteral">&#39;&#39;</span>, <span class="comment">// Selector for an alternate field to store selected dates into</span></div>
<div class="line"><a name="l07103"></a><span class="lineno"> 7103</span>&#160;        altFormat: <span class="stringliteral">&#39;&#39;</span>, <span class="comment">// The date format to use for the alternate field</span></div>
<div class="line"><a name="l07104"></a><span class="lineno"> 7104</span>&#160;        constrainInput: <span class="keyword">true</span>, <span class="comment">// The input is constrained by the current date format</span></div>
<div class="line"><a name="l07105"></a><span class="lineno"> 7105</span>&#160;        showButtonPanel: <span class="keyword">false</span>, <span class="comment">// True to show button panel, false to not show it</span></div>
<div class="line"><a name="l07106"></a><span class="lineno"> 7106</span>&#160;        autoSize: <span class="keyword">false</span>, <span class="comment">// True to size the input for the date format, false to leave as is</span></div>
<div class="line"><a name="l07107"></a><span class="lineno"> 7107</span>&#160;        disabled: <span class="keyword">false</span> <span class="comment">// The initial disabled state</span></div>
<div class="line"><a name="l07108"></a><span class="lineno"> 7108</span>&#160;    };</div>
<div class="line"><a name="l07109"></a><span class="lineno"> 7109</span>&#160;    $.extend(this._defaults, this.regional[<span class="stringliteral">&#39;&#39;</span>]);</div>
<div class="line"><a name="l07110"></a><span class="lineno"> 7110</span>&#160;    this.dpDiv = bindHover($(<span class="stringliteral">&#39;&lt;div id=&quot;&#39;</span> + this._mainDivId + <span class="stringliteral">&#39;&quot; class=&quot;ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all&quot;&gt;&lt;/div&gt;&#39;</span>));</div>
<div class="line"><a name="l07111"></a><span class="lineno"> 7111</span>&#160;}</div>
<div class="line"><a name="l07112"></a><span class="lineno"> 7112</span>&#160;</div>
<div class="line"><a name="l07113"></a><span class="lineno"> 7113</span>&#160;$.extend(Datepicker.prototype, {</div>
<div class="line"><a name="l07114"></a><span class="lineno"> 7114</span>&#160;    <span class="comment">/* Class name added to elements to indicate already configured with a date picker. */</span></div>
<div class="line"><a name="l07115"></a><span class="lineno"> 7115</span>&#160;    markerClassName: <span class="stringliteral">&#39;hasDatepicker&#39;</span>,</div>
<div class="line"><a name="l07116"></a><span class="lineno"> 7116</span>&#160;    </div>
<div class="line"><a name="l07117"></a><span class="lineno"> 7117</span>&#160;    <span class="comment">//Keep track of the maximum number of rows displayed (see #7043)</span></div>
<div class="line"><a name="l07118"></a><span class="lineno"> 7118</span>&#160;    maxRows: 4,</div>
<div class="line"><a name="l07119"></a><span class="lineno"> 7119</span>&#160;</div>
<div class="line"><a name="l07120"></a><span class="lineno"> 7120</span>&#160;    <span class="comment">/* Debug logging (if enabled). */</span></div>
<div class="line"><a name="l07121"></a><span class="lineno"> 7121</span>&#160;    log: function () {</div>
<div class="line"><a name="l07122"></a><span class="lineno"> 7122</span>&#160;        <span class="keywordflow">if</span> (this.debug)</div>
<div class="line"><a name="l07123"></a><span class="lineno"> 7123</span>&#160;            console.log.apply(<span class="stringliteral">&#39;&#39;</span>, arguments);</div>
<div class="line"><a name="l07124"></a><span class="lineno"> 7124</span>&#160;    },</div>
<div class="line"><a name="l07125"></a><span class="lineno"> 7125</span>&#160;    </div>
<div class="line"><a name="l07126"></a><span class="lineno"> 7126</span>&#160;    <span class="comment">// TODO rename to &quot;widget&quot; when switching to widget factory</span></div>
<div class="line"><a name="l07127"></a><span class="lineno"> 7127</span>&#160;    _widgetDatepicker: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l07128"></a><span class="lineno"> 7128</span>&#160;        <span class="keywordflow">return</span> this.dpDiv;</div>
<div class="line"><a name="l07129"></a><span class="lineno"> 7129</span>&#160;    },</div>
<div class="line"><a name="l07130"></a><span class="lineno"> 7130</span>&#160;</div>
<div class="line"><a name="l07131"></a><span class="lineno"> 7131</span>&#160;    <span class="comment">/* Override the default settings for all instances of the date picker.</span></div>
<div class="line"><a name="l07132"></a><span class="lineno"> 7132</span>&#160;<span class="comment">       @param  settings  object - the new settings to use as defaults (anonymous object)</span></div>
<div class="line"><a name="l07133"></a><span class="lineno"> 7133</span>&#160;<span class="comment">       @return the manager object */</span></div>
<div class="line"><a name="l07134"></a><span class="lineno"> 7134</span>&#160;    setDefaults: <span class="keyword">function</span>(settings) {</div>
<div class="line"><a name="l07135"></a><span class="lineno"> 7135</span>&#160;        extendRemove(this._defaults, settings || {});</div>
<div class="line"><a name="l07136"></a><span class="lineno"> 7136</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l07137"></a><span class="lineno"> 7137</span>&#160;    },</div>
<div class="line"><a name="l07138"></a><span class="lineno"> 7138</span>&#160;</div>
<div class="line"><a name="l07139"></a><span class="lineno"> 7139</span>&#160;    <span class="comment">/* Attach the date picker to a jQuery selection.</span></div>
<div class="line"><a name="l07140"></a><span class="lineno"> 7140</span>&#160;<span class="comment">       @param  target    element - the target input field or division or span</span></div>
<div class="line"><a name="l07141"></a><span class="lineno"> 7141</span>&#160;<span class="comment">       @param  settings  object - the new settings to use for this date picker instance (anonymous) */</span></div>
<div class="line"><a name="l07142"></a><span class="lineno"> 7142</span>&#160;    _attachDatepicker: <span class="keyword">function</span>(target, settings) {</div>
<div class="line"><a name="l07143"></a><span class="lineno"> 7143</span>&#160;        <span class="comment">// check for settings on the control itself - in namespace &#39;date:&#39;</span></div>
<div class="line"><a name="l07144"></a><span class="lineno"> 7144</span>&#160;        var inlineSettings = null;</div>
<div class="line"><a name="l07145"></a><span class="lineno"> 7145</span>&#160;        <span class="keywordflow">for</span> (var attrName in this._defaults) {</div>
<div class="line"><a name="l07146"></a><span class="lineno"> 7146</span>&#160;            var attrValue = target.getAttribute(<span class="stringliteral">&#39;date:&#39;</span> + attrName);</div>
<div class="line"><a name="l07147"></a><span class="lineno"> 7147</span>&#160;            <span class="keywordflow">if</span> (attrValue) {</div>
<div class="line"><a name="l07148"></a><span class="lineno"> 7148</span>&#160;                inlineSettings = inlineSettings || {};</div>
<div class="line"><a name="l07149"></a><span class="lineno"> 7149</span>&#160;                <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l07150"></a><span class="lineno"> 7150</span>&#160;                    inlineSettings[attrName] = eval(attrValue);</div>
<div class="line"><a name="l07151"></a><span class="lineno"> 7151</span>&#160;                } <span class="keywordflow">catch</span> (err) {</div>
<div class="line"><a name="l07152"></a><span class="lineno"> 7152</span>&#160;                    inlineSettings[attrName] = attrValue;</div>
<div class="line"><a name="l07153"></a><span class="lineno"> 7153</span>&#160;                }</div>
<div class="line"><a name="l07154"></a><span class="lineno"> 7154</span>&#160;            }</div>
<div class="line"><a name="l07155"></a><span class="lineno"> 7155</span>&#160;        }</div>
<div class="line"><a name="l07156"></a><span class="lineno"> 7156</span>&#160;        var nodeName = target.nodeName.toLowerCase();</div>
<div class="line"><a name="l07157"></a><span class="lineno"> 7157</span>&#160;        var <span class="keyword">inline</span> = (nodeName == <span class="stringliteral">&#39;div&#39;</span> || nodeName == <span class="stringliteral">&#39;span&#39;</span>);</div>
<div class="line"><a name="l07158"></a><span class="lineno"> 7158</span>&#160;        <span class="keywordflow">if</span> (!target.id) {</div>
<div class="line"><a name="l07159"></a><span class="lineno"> 7159</span>&#160;            this.uuid += 1;</div>
<div class="line"><a name="l07160"></a><span class="lineno"> 7160</span>&#160;            target.id = <span class="stringliteral">&#39;dp&#39;</span> + this.uuid;</div>
<div class="line"><a name="l07161"></a><span class="lineno"> 7161</span>&#160;        }</div>
<div class="line"><a name="l07162"></a><span class="lineno"> 7162</span>&#160;        var inst = this._newInst($(target), <span class="keyword">inline</span>);</div>
<div class="line"><a name="l07163"></a><span class="lineno"> 7163</span>&#160;        inst.settings = $.extend({}, settings || {}, inlineSettings || {});</div>
<div class="line"><a name="l07164"></a><span class="lineno"> 7164</span>&#160;        <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;input&#39;</span>) {</div>
<div class="line"><a name="l07165"></a><span class="lineno"> 7165</span>&#160;            this._connectDatepicker(target, inst);</div>
<div class="line"><a name="l07166"></a><span class="lineno"> 7166</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keyword">inline</span>) {</div>
<div class="line"><a name="l07167"></a><span class="lineno"> 7167</span>&#160;            this._inlineDatepicker(target, inst);</div>
<div class="line"><a name="l07168"></a><span class="lineno"> 7168</span>&#160;        }</div>
<div class="line"><a name="l07169"></a><span class="lineno"> 7169</span>&#160;    },</div>
<div class="line"><a name="l07170"></a><span class="lineno"> 7170</span>&#160;</div>
<div class="line"><a name="l07171"></a><span class="lineno"> 7171</span>&#160;    <span class="comment">/* Create a new instance object. */</span></div>
<div class="line"><a name="l07172"></a><span class="lineno"> 7172</span>&#160;    _newInst: <span class="keyword">function</span>(target, <span class="keyword">inline</span>) {</div>
<div class="line"><a name="l07173"></a><span class="lineno"> 7173</span>&#160;        var <span class="keywordtype">id</span> = target[0].id.replace(/([^A-Za-z0-9_-])/g, <span class="stringliteral">&#39;\\\\$1&#39;</span>); <span class="comment">// escape jQuery meta chars</span></div>
<div class="line"><a name="l07174"></a><span class="lineno"> 7174</span>&#160;        <span class="keywordflow">return</span> {<span class="keywordtype">id</span>: id, input: target, <span class="comment">// associated target</span></div>
<div class="line"><a name="l07175"></a><span class="lineno"> 7175</span>&#160;            selectedDay: 0, selectedMonth: 0, selectedYear: 0, <span class="comment">// current selection</span></div>
<div class="line"><a name="l07176"></a><span class="lineno"> 7176</span>&#160;            drawMonth: 0, drawYear: 0, <span class="comment">// month being drawn</span></div>
<div class="line"><a name="l07177"></a><span class="lineno"> 7177</span>&#160;            <span class="keyword">inline</span>: <span class="keyword">inline</span>, <span class="comment">// is datepicker inline or not</span></div>
<div class="line"><a name="l07178"></a><span class="lineno"> 7178</span>&#160;            dpDiv: (!<span class="keyword">inline</span> ? this.dpDiv : <span class="comment">// presentation div</span></div>
<div class="line"><a name="l07179"></a><span class="lineno"> 7179</span>&#160;            bindHover($(<span class="stringliteral">&#39;&lt;div class=&quot;&#39;</span> + this._inlineClass + <span class="stringliteral">&#39; ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all&quot;&gt;&lt;/div&gt;&#39;</span>)))};</div>
<div class="line"><a name="l07180"></a><span class="lineno"> 7180</span>&#160;    },</div>
<div class="line"><a name="l07181"></a><span class="lineno"> 7181</span>&#160;</div>
<div class="line"><a name="l07182"></a><span class="lineno"> 7182</span>&#160;    <span class="comment">/* Attach the date picker to an input field. */</span></div>
<div class="line"><a name="l07183"></a><span class="lineno"> 7183</span>&#160;    _connectDatepicker: <span class="keyword">function</span>(target, inst) {</div>
<div class="line"><a name="l07184"></a><span class="lineno"> 7184</span>&#160;        var input = $(target);</div>
<div class="line"><a name="l07185"></a><span class="lineno"> 7185</span>&#160;        inst.append = $([]);</div>
<div class="line"><a name="l07186"></a><span class="lineno"> 7186</span>&#160;        inst.trigger = $([]);</div>
<div class="line"><a name="l07187"></a><span class="lineno"> 7187</span>&#160;        <span class="keywordflow">if</span> (input.hasClass(<span class="keyword">this</span>.markerClassName))</div>
<div class="line"><a name="l07188"></a><span class="lineno"> 7188</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07189"></a><span class="lineno"> 7189</span>&#160;        this._attachments(input, inst);</div>
<div class="line"><a name="l07190"></a><span class="lineno"> 7190</span>&#160;        input.addClass(this.markerClassName).keydown(this._doKeyDown).</div>
<div class="line"><a name="l07191"></a><span class="lineno"> 7191</span>&#160;            keypress(this._doKeyPress).keyup(this._doKeyUp).</div>
<div class="line"><a name="l07192"></a><span class="lineno"> 7192</span>&#160;            bind(<span class="stringliteral">&quot;setData.datepicker&quot;</span>, <span class="keyword">function</span>(event, key, value) {</div>
<div class="line"><a name="l07193"></a><span class="lineno"> 7193</span>&#160;                inst.settings[key] = value;</div>
<div class="line"><a name="l07194"></a><span class="lineno"> 7194</span>&#160;            }).bind(<span class="stringliteral">&quot;getData.datepicker&quot;</span>, <span class="keyword">function</span>(event, key) {</div>
<div class="line"><a name="l07195"></a><span class="lineno"> 7195</span>&#160;                <span class="keywordflow">return</span> this._get(inst, key);</div>
<div class="line"><a name="l07196"></a><span class="lineno"> 7196</span>&#160;            });</div>
<div class="line"><a name="l07197"></a><span class="lineno"> 7197</span>&#160;        this._autoSize(inst);</div>
<div class="line"><a name="l07198"></a><span class="lineno"> 7198</span>&#160;        $.data(target, PROP_NAME, inst);</div>
<div class="line"><a name="l07199"></a><span class="lineno"> 7199</span>&#160;        <span class="comment">//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)</span></div>
<div class="line"><a name="l07200"></a><span class="lineno"> 7200</span>&#160;        <span class="keywordflow">if</span>( inst.settings.disabled ) {</div>
<div class="line"><a name="l07201"></a><span class="lineno"> 7201</span>&#160;            this._disableDatepicker( target );</div>
<div class="line"><a name="l07202"></a><span class="lineno"> 7202</span>&#160;        }</div>
<div class="line"><a name="l07203"></a><span class="lineno"> 7203</span>&#160;    },</div>
<div class="line"><a name="l07204"></a><span class="lineno"> 7204</span>&#160;</div>
<div class="line"><a name="l07205"></a><span class="lineno"> 7205</span>&#160;    <span class="comment">/* Make attachments based on settings. */</span></div>
<div class="line"><a name="l07206"></a><span class="lineno"> 7206</span>&#160;    _attachments: <span class="keyword">function</span>(input, inst) {</div>
<div class="line"><a name="l07207"></a><span class="lineno"> 7207</span>&#160;        var appendText = this._get(inst, <span class="stringliteral">&#39;appendText&#39;</span>);</div>
<div class="line"><a name="l07208"></a><span class="lineno"> 7208</span>&#160;        var isRTL = this._get(inst, <span class="stringliteral">&#39;isRTL&#39;</span>);</div>
<div class="line"><a name="l07209"></a><span class="lineno"> 7209</span>&#160;        <span class="keywordflow">if</span> (inst.append)</div>
<div class="line"><a name="l07210"></a><span class="lineno"> 7210</span>&#160;            inst.append.remove();</div>
<div class="line"><a name="l07211"></a><span class="lineno"> 7211</span>&#160;        <span class="keywordflow">if</span> (appendText) {</div>
<div class="line"><a name="l07212"></a><span class="lineno"> 7212</span>&#160;            inst.append = $(<span class="stringliteral">&#39;&lt;span class=&quot;&#39;</span> + this._appendClass + <span class="stringliteral">&#39;&quot;&gt;&#39;</span> + appendText + <span class="stringliteral">&#39;&lt;/span&gt;&#39;</span>);</div>
<div class="line"><a name="l07213"></a><span class="lineno"> 7213</span>&#160;            input[isRTL ? <span class="stringliteral">&#39;before&#39;</span> : <span class="stringliteral">&#39;after&#39;</span>](inst.append);</div>
<div class="line"><a name="l07214"></a><span class="lineno"> 7214</span>&#160;        }</div>
<div class="line"><a name="l07215"></a><span class="lineno"> 7215</span>&#160;        input.unbind(<span class="stringliteral">&#39;focus&#39;</span>, this._showDatepicker);</div>
<div class="line"><a name="l07216"></a><span class="lineno"> 7216</span>&#160;        <span class="keywordflow">if</span> (inst.trigger)</div>
<div class="line"><a name="l07217"></a><span class="lineno"> 7217</span>&#160;            inst.trigger.remove();</div>
<div class="line"><a name="l07218"></a><span class="lineno"> 7218</span>&#160;        var showOn = this._get(inst, <span class="stringliteral">&#39;showOn&#39;</span>);</div>
<div class="line"><a name="l07219"></a><span class="lineno"> 7219</span>&#160;        <span class="keywordflow">if</span> (showOn == <span class="stringliteral">&#39;focus&#39;</span> || showOn == <span class="stringliteral">&#39;both&#39;</span>) <span class="comment">// pop-up date picker when in the marked field</span></div>
<div class="line"><a name="l07220"></a><span class="lineno"> 7220</span>&#160;            input.focus(this._showDatepicker);</div>
<div class="line"><a name="l07221"></a><span class="lineno"> 7221</span>&#160;        <span class="keywordflow">if</span> (showOn == <span class="stringliteral">&#39;button&#39;</span> || showOn == <span class="stringliteral">&#39;both&#39;</span>) { <span class="comment">// pop-up date picker when button clicked</span></div>
<div class="line"><a name="l07222"></a><span class="lineno"> 7222</span>&#160;            var buttonText = this._get(inst, <span class="stringliteral">&#39;buttonText&#39;</span>);</div>
<div class="line"><a name="l07223"></a><span class="lineno"> 7223</span>&#160;            var buttonImage = this._get(inst, <span class="stringliteral">&#39;buttonImage&#39;</span>);</div>
<div class="line"><a name="l07224"></a><span class="lineno"> 7224</span>&#160;            inst.trigger = $(this._get(inst, <span class="stringliteral">&#39;buttonImageOnly&#39;</span>) ?</div>
<div class="line"><a name="l07225"></a><span class="lineno"> 7225</span>&#160;                $(<span class="stringliteral">&#39;&lt;img/&gt;&#39;</span>).addClass(this._triggerClass).</div>
<div class="line"><a name="l07226"></a><span class="lineno"> 7226</span>&#160;                    attr({ src: buttonImage, alt: buttonText, title: buttonText }) :</div>
<div class="line"><a name="l07227"></a><span class="lineno"> 7227</span>&#160;                $(<span class="stringliteral">&#39;&lt;button type=&quot;button&quot;&gt;&lt;/button&gt;&#39;</span>).addClass(this._triggerClass).</div>
<div class="line"><a name="l07228"></a><span class="lineno"> 7228</span>&#160;                    html(buttonImage == <span class="stringliteral">&#39;&#39;</span> ? buttonText : $(<span class="stringliteral">&#39;&lt;img/&gt;&#39;</span>).attr(</div>
<div class="line"><a name="l07229"></a><span class="lineno"> 7229</span>&#160;                    { src:buttonImage, alt:buttonText, title:buttonText })));</div>
<div class="line"><a name="l07230"></a><span class="lineno"> 7230</span>&#160;            input[isRTL ? <span class="stringliteral">&#39;before&#39;</span> : <span class="stringliteral">&#39;after&#39;</span>](inst.trigger);</div>
<div class="line"><a name="l07231"></a><span class="lineno"> 7231</span>&#160;            inst.trigger.click(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l07232"></a><span class="lineno"> 7232</span>&#160;                <span class="keywordflow">if</span> ($.datepicker._datepickerShowing &amp;&amp; $.datepicker._lastInput == input[0])</div>
<div class="line"><a name="l07233"></a><span class="lineno"> 7233</span>&#160;                    $.datepicker._hideDatepicker();</div>
<div class="line"><a name="l07234"></a><span class="lineno"> 7234</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span> ($.datepicker._datepickerShowing &amp;&amp; $.datepicker._lastInput != input[0]) {</div>
<div class="line"><a name="l07235"></a><span class="lineno"> 7235</span>&#160;                    $.datepicker._hideDatepicker(); </div>
<div class="line"><a name="l07236"></a><span class="lineno"> 7236</span>&#160;                    $.datepicker._showDatepicker(input[0]);</div>
<div class="line"><a name="l07237"></a><span class="lineno"> 7237</span>&#160;                } <span class="keywordflow">else</span></div>
<div class="line"><a name="l07238"></a><span class="lineno"> 7238</span>&#160;                    $.datepicker._showDatepicker(input[0]);</div>
<div class="line"><a name="l07239"></a><span class="lineno"> 7239</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l07240"></a><span class="lineno"> 7240</span>&#160;            });</div>
<div class="line"><a name="l07241"></a><span class="lineno"> 7241</span>&#160;        }</div>
<div class="line"><a name="l07242"></a><span class="lineno"> 7242</span>&#160;    },</div>
<div class="line"><a name="l07243"></a><span class="lineno"> 7243</span>&#160;</div>
<div class="line"><a name="l07244"></a><span class="lineno"> 7244</span>&#160;    <span class="comment">/* Apply the maximum length for the date format. */</span></div>
<div class="line"><a name="l07245"></a><span class="lineno"> 7245</span>&#160;    _autoSize: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l07246"></a><span class="lineno"> 7246</span>&#160;        <span class="keywordflow">if</span> (this._get(inst, <span class="stringliteral">&#39;autoSize&#39;</span>) &amp;&amp; !inst.inline) {</div>
<div class="line"><a name="l07247"></a><span class="lineno"> 7247</span>&#160;            var date = <span class="keyword">new</span> Date(2009, 12 - 1, 20); <span class="comment">// Ensure double digits</span></div>
<div class="line"><a name="l07248"></a><span class="lineno"> 7248</span>&#160;            var dateFormat = this._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>);</div>
<div class="line"><a name="l07249"></a><span class="lineno"> 7249</span>&#160;            <span class="keywordflow">if</span> (dateFormat.match(/[DM]/)) {</div>
<div class="line"><a name="l07250"></a><span class="lineno"> 7250</span>&#160;                var findMax = <span class="keyword">function</span>(names) {</div>
<div class="line"><a name="l07251"></a><span class="lineno"> 7251</span>&#160;                    var max = 0;</div>
<div class="line"><a name="l07252"></a><span class="lineno"> 7252</span>&#160;                    var maxI = 0;</div>
<div class="line"><a name="l07253"></a><span class="lineno"> 7253</span>&#160;                    <span class="keywordflow">for</span> (var i = 0; i &lt; names.length; i++) {</div>
<div class="line"><a name="l07254"></a><span class="lineno"> 7254</span>&#160;                        <span class="keywordflow">if</span> (names[i].length &gt; max) {</div>
<div class="line"><a name="l07255"></a><span class="lineno"> 7255</span>&#160;                            max = names[i].length;</div>
<div class="line"><a name="l07256"></a><span class="lineno"> 7256</span>&#160;                            maxI = i;</div>
<div class="line"><a name="l07257"></a><span class="lineno"> 7257</span>&#160;                        }</div>
<div class="line"><a name="l07258"></a><span class="lineno"> 7258</span>&#160;                    }</div>
<div class="line"><a name="l07259"></a><span class="lineno"> 7259</span>&#160;                    <span class="keywordflow">return</span> maxI;</div>
<div class="line"><a name="l07260"></a><span class="lineno"> 7260</span>&#160;                };</div>
<div class="line"><a name="l07261"></a><span class="lineno"> 7261</span>&#160;                date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?</div>
<div class="line"><a name="l07262"></a><span class="lineno"> 7262</span>&#160;                    <span class="stringliteral">&#39;monthNames&#39;</span> : <span class="stringliteral">&#39;monthNamesShort&#39;</span>))));</div>
<div class="line"><a name="l07263"></a><span class="lineno"> 7263</span>&#160;                date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?</div>
<div class="line"><a name="l07264"></a><span class="lineno"> 7264</span>&#160;                    <span class="stringliteral">&#39;dayNames&#39;</span> : <span class="stringliteral">&#39;dayNamesShort&#39;</span>))) + 20 - date.getDay());</div>
<div class="line"><a name="l07265"></a><span class="lineno"> 7265</span>&#160;            }</div>
<div class="line"><a name="l07266"></a><span class="lineno"> 7266</span>&#160;            inst.input.attr(<span class="stringliteral">&#39;size&#39;</span>, this._formatDate(inst, date).length);</div>
<div class="line"><a name="l07267"></a><span class="lineno"> 7267</span>&#160;        }</div>
<div class="line"><a name="l07268"></a><span class="lineno"> 7268</span>&#160;    },</div>
<div class="line"><a name="l07269"></a><span class="lineno"> 7269</span>&#160;</div>
<div class="line"><a name="l07270"></a><span class="lineno"> 7270</span>&#160;    <span class="comment">/* Attach an inline date picker to a div. */</span></div>
<div class="line"><a name="l07271"></a><span class="lineno"> 7271</span>&#160;    _inlineDatepicker: <span class="keyword">function</span>(target, inst) {</div>
<div class="line"><a name="l07272"></a><span class="lineno"> 7272</span>&#160;        var divSpan = $(target);</div>
<div class="line"><a name="l07273"></a><span class="lineno"> 7273</span>&#160;        <span class="keywordflow">if</span> (divSpan.hasClass(<span class="keyword">this</span>.markerClassName))</div>
<div class="line"><a name="l07274"></a><span class="lineno"> 7274</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07275"></a><span class="lineno"> 7275</span>&#160;        divSpan.addClass(this.markerClassName).append(inst.dpDiv).</div>
<div class="line"><a name="l07276"></a><span class="lineno"> 7276</span>&#160;            bind(<span class="stringliteral">&quot;setData.datepicker&quot;</span>, <span class="keyword">function</span>(event, key, value){</div>
<div class="line"><a name="l07277"></a><span class="lineno"> 7277</span>&#160;                inst.settings[key] = value;</div>
<div class="line"><a name="l07278"></a><span class="lineno"> 7278</span>&#160;            }).bind(<span class="stringliteral">&quot;getData.datepicker&quot;</span>, <span class="keyword">function</span>(event, key){</div>
<div class="line"><a name="l07279"></a><span class="lineno"> 7279</span>&#160;                <span class="keywordflow">return</span> this._get(inst, key);</div>
<div class="line"><a name="l07280"></a><span class="lineno"> 7280</span>&#160;            });</div>
<div class="line"><a name="l07281"></a><span class="lineno"> 7281</span>&#160;        $.data(target, PROP_NAME, inst);</div>
<div class="line"><a name="l07282"></a><span class="lineno"> 7282</span>&#160;        this._setDate(inst, this._getDefaultDate(inst), <span class="keyword">true</span>);</div>
<div class="line"><a name="l07283"></a><span class="lineno"> 7283</span>&#160;        this._updateDatepicker(inst);</div>
<div class="line"><a name="l07284"></a><span class="lineno"> 7284</span>&#160;        this._updateAlternate(inst);</div>
<div class="line"><a name="l07285"></a><span class="lineno"> 7285</span>&#160;        <span class="comment">//If disabled option is true, disable the datepicker before showing it (see ticket #5665)</span></div>
<div class="line"><a name="l07286"></a><span class="lineno"> 7286</span>&#160;        <span class="keywordflow">if</span>( inst.settings.disabled ) {</div>
<div class="line"><a name="l07287"></a><span class="lineno"> 7287</span>&#160;            this._disableDatepicker( target );</div>
<div class="line"><a name="l07288"></a><span class="lineno"> 7288</span>&#160;        }</div>
<div class="line"><a name="l07289"></a><span class="lineno"> 7289</span>&#160;        <span class="comment">// Set display:block in place of inst.dpDiv.show() which won&#39;t work on disconnected elements</span></div>
<div class="line"><a name="l07290"></a><span class="lineno"> 7290</span>&#160;        <span class="comment">// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height</span></div>
<div class="line"><a name="l07291"></a><span class="lineno"> 7291</span>&#160;        inst.dpDiv.css( <span class="stringliteral">&quot;display&quot;</span>, <span class="stringliteral">&quot;block&quot;</span> );</div>
<div class="line"><a name="l07292"></a><span class="lineno"> 7292</span>&#160;    },</div>
<div class="line"><a name="l07293"></a><span class="lineno"> 7293</span>&#160;</div>
<div class="line"><a name="l07294"></a><span class="lineno"> 7294</span>&#160;    <span class="comment">/* Pop-up the date picker in a &quot;dialog&quot; box.</span></div>
<div class="line"><a name="l07295"></a><span class="lineno"> 7295</span>&#160;<span class="comment">       @param  input     element - ignored</span></div>
<div class="line"><a name="l07296"></a><span class="lineno"> 7296</span>&#160;<span class="comment">       @param  date      string or Date - the initial date to display</span></div>
<div class="line"><a name="l07297"></a><span class="lineno"> 7297</span>&#160;<span class="comment">       @param  onSelect  function - the function to call when a date is selected</span></div>
<div class="line"><a name="l07298"></a><span class="lineno"> 7298</span>&#160;<span class="comment">       @param  settings  object - update the dialog date picker instance&#39;s settings (anonymous object)</span></div>
<div class="line"><a name="l07299"></a><span class="lineno"> 7299</span>&#160;<span class="comment">       @param  pos       int[2] - coordinates for the dialog&#39;s position within the screen or</span></div>
<div class="line"><a name="l07300"></a><span class="lineno"> 7300</span>&#160;<span class="comment">                         event - with x/y coordinates or</span></div>
<div class="line"><a name="l07301"></a><span class="lineno"> 7301</span>&#160;<span class="comment">                         leave empty for default (screen centre)</span></div>
<div class="line"><a name="l07302"></a><span class="lineno"> 7302</span>&#160;<span class="comment">       @return the manager object */</span></div>
<div class="line"><a name="l07303"></a><span class="lineno"> 7303</span>&#160;    _dialogDatepicker: <span class="keyword">function</span>(input, date, onSelect, settings, pos) {</div>
<div class="line"><a name="l07304"></a><span class="lineno"> 7304</span>&#160;        var inst = this._dialogInst; <span class="comment">// internal instance</span></div>
<div class="line"><a name="l07305"></a><span class="lineno"> 7305</span>&#160;        <span class="keywordflow">if</span> (!inst) {</div>
<div class="line"><a name="l07306"></a><span class="lineno"> 7306</span>&#160;            this.uuid += 1;</div>
<div class="line"><a name="l07307"></a><span class="lineno"> 7307</span>&#160;            var <span class="keywordtype">id</span> = <span class="stringliteral">&#39;dp&#39;</span> + this.uuid;</div>
<div class="line"><a name="l07308"></a><span class="lineno"> 7308</span>&#160;            this._dialogInput = $(<span class="stringliteral">&#39;&lt;input type=&quot;text&quot; id=&quot;&#39;</span> + <span class="keywordtype">id</span> +</div>
<div class="line"><a name="l07309"></a><span class="lineno"> 7309</span>&#160;                <span class="stringliteral">&#39;&quot; style=&quot;position: absolute; top: -100px; width: 0px; z-index: -10;&quot;/&gt;&#39;</span>);</div>
<div class="line"><a name="l07310"></a><span class="lineno"> 7310</span>&#160;            this._dialogInput.keydown(this._doKeyDown);</div>
<div class="line"><a name="l07311"></a><span class="lineno"> 7311</span>&#160;            $(<span class="stringliteral">&#39;body&#39;</span>).append(this._dialogInput);</div>
<div class="line"><a name="l07312"></a><span class="lineno"> 7312</span>&#160;            inst = this._dialogInst = this._newInst(this._dialogInput, <span class="keyword">false</span>);</div>
<div class="line"><a name="l07313"></a><span class="lineno"> 7313</span>&#160;            inst.settings = {};</div>
<div class="line"><a name="l07314"></a><span class="lineno"> 7314</span>&#160;            $.data(this._dialogInput[0], PROP_NAME, inst);</div>
<div class="line"><a name="l07315"></a><span class="lineno"> 7315</span>&#160;        }</div>
<div class="line"><a name="l07316"></a><span class="lineno"> 7316</span>&#160;        extendRemove(inst.settings, settings || {});</div>
<div class="line"><a name="l07317"></a><span class="lineno"> 7317</span>&#160;        date = (date &amp;&amp; date.constructor == Date ? this._formatDate(inst, date) : date);</div>
<div class="line"><a name="l07318"></a><span class="lineno"> 7318</span>&#160;        this._dialogInput.val(date);</div>
<div class="line"><a name="l07319"></a><span class="lineno"> 7319</span>&#160;</div>
<div class="line"><a name="l07320"></a><span class="lineno"> 7320</span>&#160;        this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);</div>
<div class="line"><a name="l07321"></a><span class="lineno"> 7321</span>&#160;        <span class="keywordflow">if</span> (!this._pos) {</div>
<div class="line"><a name="l07322"></a><span class="lineno"> 7322</span>&#160;            var browserWidth = document.documentElement.clientWidth;</div>
<div class="line"><a name="l07323"></a><span class="lineno"> 7323</span>&#160;            var browserHeight = document.documentElement.clientHeight;</div>
<div class="line"><a name="l07324"></a><span class="lineno"> 7324</span>&#160;            var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;</div>
<div class="line"><a name="l07325"></a><span class="lineno"> 7325</span>&#160;            var scrollY = document.documentElement.scrollTop || document.body.scrollTop;</div>
<div class="line"><a name="l07326"></a><span class="lineno"> 7326</span>&#160;            this._pos = <span class="comment">// should use actual width/height below</span></div>
<div class="line"><a name="l07327"></a><span class="lineno"> 7327</span>&#160;                [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];</div>
<div class="line"><a name="l07328"></a><span class="lineno"> 7328</span>&#160;        }</div>
<div class="line"><a name="l07329"></a><span class="lineno"> 7329</span>&#160;</div>
<div class="line"><a name="l07330"></a><span class="lineno"> 7330</span>&#160;        <span class="comment">// move input on screen for focus, but hidden behind dialog</span></div>
<div class="line"><a name="l07331"></a><span class="lineno"> 7331</span>&#160;        this._dialogInput.css(<span class="stringliteral">&#39;left&#39;</span>, (this._pos[0] + 20) + <span class="stringliteral">&#39;px&#39;</span>).css(<span class="stringliteral">&#39;top&#39;</span>, this._pos[1] + <span class="stringliteral">&#39;px&#39;</span>);</div>
<div class="line"><a name="l07332"></a><span class="lineno"> 7332</span>&#160;        inst.settings.onSelect = onSelect;</div>
<div class="line"><a name="l07333"></a><span class="lineno"> 7333</span>&#160;        this._inDialog = <span class="keyword">true</span>;</div>
<div class="line"><a name="l07334"></a><span class="lineno"> 7334</span>&#160;        this.dpDiv.addClass(this._dialogClass);</div>
<div class="line"><a name="l07335"></a><span class="lineno"> 7335</span>&#160;        this._showDatepicker(this._dialogInput[0]);</div>
<div class="line"><a name="l07336"></a><span class="lineno"> 7336</span>&#160;        <span class="keywordflow">if</span> ($.blockUI)</div>
<div class="line"><a name="l07337"></a><span class="lineno"> 7337</span>&#160;            $.blockUI(this.dpDiv);</div>
<div class="line"><a name="l07338"></a><span class="lineno"> 7338</span>&#160;        $.data(this._dialogInput[0], PROP_NAME, inst);</div>
<div class="line"><a name="l07339"></a><span class="lineno"> 7339</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l07340"></a><span class="lineno"> 7340</span>&#160;    },</div>
<div class="line"><a name="l07341"></a><span class="lineno"> 7341</span>&#160;</div>
<div class="line"><a name="l07342"></a><span class="lineno"> 7342</span>&#160;    <span class="comment">/* Detach a datepicker from its control.</span></div>
<div class="line"><a name="l07343"></a><span class="lineno"> 7343</span>&#160;<span class="comment">       @param  target    element - the target input field or division or span */</span></div>
<div class="line"><a name="l07344"></a><span class="lineno"> 7344</span>&#160;    _destroyDatepicker: <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l07345"></a><span class="lineno"> 7345</span>&#160;        var $target = $(target);</div>
<div class="line"><a name="l07346"></a><span class="lineno"> 7346</span>&#160;        var inst = $.data(target, PROP_NAME);</div>
<div class="line"><a name="l07347"></a><span class="lineno"> 7347</span>&#160;        <span class="keywordflow">if</span> (!$target.hasClass(<span class="keyword">this</span>.markerClassName)) {</div>
<div class="line"><a name="l07348"></a><span class="lineno"> 7348</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07349"></a><span class="lineno"> 7349</span>&#160;        }</div>
<div class="line"><a name="l07350"></a><span class="lineno"> 7350</span>&#160;        var nodeName = target.nodeName.toLowerCase();</div>
<div class="line"><a name="l07351"></a><span class="lineno"> 7351</span>&#160;        $.removeData(target, PROP_NAME);</div>
<div class="line"><a name="l07352"></a><span class="lineno"> 7352</span>&#160;        <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;input&#39;</span>) {</div>
<div class="line"><a name="l07353"></a><span class="lineno"> 7353</span>&#160;            inst.append.remove();</div>
<div class="line"><a name="l07354"></a><span class="lineno"> 7354</span>&#160;            inst.trigger.remove();</div>
<div class="line"><a name="l07355"></a><span class="lineno"> 7355</span>&#160;            $target.removeClass(this.markerClassName).</div>
<div class="line"><a name="l07356"></a><span class="lineno"> 7356</span>&#160;                unbind(<span class="stringliteral">&#39;focus&#39;</span>, this._showDatepicker).</div>
<div class="line"><a name="l07357"></a><span class="lineno"> 7357</span>&#160;                unbind(<span class="stringliteral">&#39;keydown&#39;</span>, this._doKeyDown).</div>
<div class="line"><a name="l07358"></a><span class="lineno"> 7358</span>&#160;                unbind(<span class="stringliteral">&#39;keypress&#39;</span>, this._doKeyPress).</div>
<div class="line"><a name="l07359"></a><span class="lineno"> 7359</span>&#160;                unbind(<span class="stringliteral">&#39;keyup&#39;</span>, this._doKeyUp);</div>
<div class="line"><a name="l07360"></a><span class="lineno"> 7360</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;div&#39;</span> || nodeName == <span class="stringliteral">&#39;span&#39;</span>)</div>
<div class="line"><a name="l07361"></a><span class="lineno"> 7361</span>&#160;            $target.removeClass(this.markerClassName).empty();</div>
<div class="line"><a name="l07362"></a><span class="lineno"> 7362</span>&#160;    },</div>
<div class="line"><a name="l07363"></a><span class="lineno"> 7363</span>&#160;</div>
<div class="line"><a name="l07364"></a><span class="lineno"> 7364</span>&#160;    <span class="comment">/* Enable the date picker to a jQuery selection.</span></div>
<div class="line"><a name="l07365"></a><span class="lineno"> 7365</span>&#160;<span class="comment">       @param  target    element - the target input field or division or span */</span></div>
<div class="line"><a name="l07366"></a><span class="lineno"> 7366</span>&#160;    _enableDatepicker: <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l07367"></a><span class="lineno"> 7367</span>&#160;        var $target = $(target);</div>
<div class="line"><a name="l07368"></a><span class="lineno"> 7368</span>&#160;        var inst = $.data(target, PROP_NAME);</div>
<div class="line"><a name="l07369"></a><span class="lineno"> 7369</span>&#160;        <span class="keywordflow">if</span> (!$target.hasClass(<span class="keyword">this</span>.markerClassName)) {</div>
<div class="line"><a name="l07370"></a><span class="lineno"> 7370</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07371"></a><span class="lineno"> 7371</span>&#160;        }</div>
<div class="line"><a name="l07372"></a><span class="lineno"> 7372</span>&#160;        var nodeName = target.nodeName.toLowerCase();</div>
<div class="line"><a name="l07373"></a><span class="lineno"> 7373</span>&#160;        <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;input&#39;</span>) {</div>
<div class="line"><a name="l07374"></a><span class="lineno"> 7374</span>&#160;            target.disabled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07375"></a><span class="lineno"> 7375</span>&#160;            inst.trigger.filter(<span class="stringliteral">&#39;button&#39;</span>).</div>
<div class="line"><a name="l07376"></a><span class="lineno"> 7376</span>&#160;                each(<span class="keyword">function</span>() { this.disabled = <span class="keyword">false</span>; }).end().</div>
<div class="line"><a name="l07377"></a><span class="lineno"> 7377</span>&#160;                filter(<span class="stringliteral">&#39;img&#39;</span>).css({opacity: <span class="stringliteral">&#39;1.0&#39;</span>, cursor: <span class="stringliteral">&#39;&#39;</span>});</div>
<div class="line"><a name="l07378"></a><span class="lineno"> 7378</span>&#160;        }</div>
<div class="line"><a name="l07379"></a><span class="lineno"> 7379</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;div&#39;</span> || nodeName == <span class="stringliteral">&#39;span&#39;</span>) {</div>
<div class="line"><a name="l07380"></a><span class="lineno"> 7380</span>&#160;            var <span class="keyword">inline</span> = $target.children(<span class="charliteral">&#39;.&#39;</span> + this._inlineClass);</div>
<div class="line"><a name="l07381"></a><span class="lineno"> 7381</span>&#160;            <span class="keyword">inline</span>.children().removeClass(<span class="stringliteral">&#39;ui-state-disabled&#39;</span>);</div>
<div class="line"><a name="l07382"></a><span class="lineno"> 7382</span>&#160;            <span class="keyword">inline</span>.find(<span class="stringliteral">&quot;select.ui-datepicker-month, select.ui-datepicker-year&quot;</span>).</div>
<div class="line"><a name="l07383"></a><span class="lineno"> 7383</span>&#160;                removeAttr(<span class="stringliteral">&quot;disabled&quot;</span>);</div>
<div class="line"><a name="l07384"></a><span class="lineno"> 7384</span>&#160;        }</div>
<div class="line"><a name="l07385"></a><span class="lineno"> 7385</span>&#160;        this._disabledInputs = $.map(this._disabledInputs,</div>
<div class="line"><a name="l07386"></a><span class="lineno"> 7386</span>&#160;            <span class="keyword">function</span>(value) { <span class="keywordflow">return</span> (value == target ? null : value); }); <span class="comment">// delete entry</span></div>
<div class="line"><a name="l07387"></a><span class="lineno"> 7387</span>&#160;    },</div>
<div class="line"><a name="l07388"></a><span class="lineno"> 7388</span>&#160;</div>
<div class="line"><a name="l07389"></a><span class="lineno"> 7389</span>&#160;    <span class="comment">/* Disable the date picker to a jQuery selection.</span></div>
<div class="line"><a name="l07390"></a><span class="lineno"> 7390</span>&#160;<span class="comment">       @param  target    element - the target input field or division or span */</span></div>
<div class="line"><a name="l07391"></a><span class="lineno"> 7391</span>&#160;    _disableDatepicker: <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l07392"></a><span class="lineno"> 7392</span>&#160;        var $target = $(target);</div>
<div class="line"><a name="l07393"></a><span class="lineno"> 7393</span>&#160;        var inst = $.data(target, PROP_NAME);</div>
<div class="line"><a name="l07394"></a><span class="lineno"> 7394</span>&#160;        <span class="keywordflow">if</span> (!$target.hasClass(<span class="keyword">this</span>.markerClassName)) {</div>
<div class="line"><a name="l07395"></a><span class="lineno"> 7395</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07396"></a><span class="lineno"> 7396</span>&#160;        }</div>
<div class="line"><a name="l07397"></a><span class="lineno"> 7397</span>&#160;        var nodeName = target.nodeName.toLowerCase();</div>
<div class="line"><a name="l07398"></a><span class="lineno"> 7398</span>&#160;        <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;input&#39;</span>) {</div>
<div class="line"><a name="l07399"></a><span class="lineno"> 7399</span>&#160;            target.disabled = <span class="keyword">true</span>;</div>
<div class="line"><a name="l07400"></a><span class="lineno"> 7400</span>&#160;            inst.trigger.filter(<span class="stringliteral">&#39;button&#39;</span>).</div>
<div class="line"><a name="l07401"></a><span class="lineno"> 7401</span>&#160;                each(<span class="keyword">function</span>() { this.disabled = <span class="keyword">true</span>; }).end().</div>
<div class="line"><a name="l07402"></a><span class="lineno"> 7402</span>&#160;                filter(<span class="stringliteral">&#39;img&#39;</span>).css({opacity: <span class="stringliteral">&#39;0.5&#39;</span>, cursor: <span class="stringliteral">&#39;default&#39;</span>});</div>
<div class="line"><a name="l07403"></a><span class="lineno"> 7403</span>&#160;        }</div>
<div class="line"><a name="l07404"></a><span class="lineno"> 7404</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nodeName == <span class="stringliteral">&#39;div&#39;</span> || nodeName == <span class="stringliteral">&#39;span&#39;</span>) {</div>
<div class="line"><a name="l07405"></a><span class="lineno"> 7405</span>&#160;            var <span class="keyword">inline</span> = $target.children(<span class="charliteral">&#39;.&#39;</span> + this._inlineClass);</div>
<div class="line"><a name="l07406"></a><span class="lineno"> 7406</span>&#160;            <span class="keyword">inline</span>.children().addClass(<span class="stringliteral">&#39;ui-state-disabled&#39;</span>);</div>
<div class="line"><a name="l07407"></a><span class="lineno"> 7407</span>&#160;            <span class="keyword">inline</span>.find(<span class="stringliteral">&quot;select.ui-datepicker-month, select.ui-datepicker-year&quot;</span>).</div>
<div class="line"><a name="l07408"></a><span class="lineno"> 7408</span>&#160;                attr(<span class="stringliteral">&quot;disabled&quot;</span>, <span class="stringliteral">&quot;disabled&quot;</span>);</div>
<div class="line"><a name="l07409"></a><span class="lineno"> 7409</span>&#160;        }</div>
<div class="line"><a name="l07410"></a><span class="lineno"> 7410</span>&#160;        this._disabledInputs = $.map(this._disabledInputs,</div>
<div class="line"><a name="l07411"></a><span class="lineno"> 7411</span>&#160;            <span class="keyword">function</span>(value) { <span class="keywordflow">return</span> (value == target ? null : value); }); <span class="comment">// delete entry</span></div>
<div class="line"><a name="l07412"></a><span class="lineno"> 7412</span>&#160;        this._disabledInputs[this._disabledInputs.length] = target;</div>
<div class="line"><a name="l07413"></a><span class="lineno"> 7413</span>&#160;    },</div>
<div class="line"><a name="l07414"></a><span class="lineno"> 7414</span>&#160;</div>
<div class="line"><a name="l07415"></a><span class="lineno"> 7415</span>&#160;    <span class="comment">/* Is the first field in a jQuery collection disabled as a datepicker?</span></div>
<div class="line"><a name="l07416"></a><span class="lineno"> 7416</span>&#160;<span class="comment">       @param  target    element - the target input field or division or span</span></div>
<div class="line"><a name="l07417"></a><span class="lineno"> 7417</span>&#160;<span class="comment">       @return boolean - true if disabled, false if enabled */</span></div>
<div class="line"><a name="l07418"></a><span class="lineno"> 7418</span>&#160;    _isDisabledDatepicker: <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l07419"></a><span class="lineno"> 7419</span>&#160;        <span class="keywordflow">if</span> (!target) {</div>
<div class="line"><a name="l07420"></a><span class="lineno"> 7420</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l07421"></a><span class="lineno"> 7421</span>&#160;        }</div>
<div class="line"><a name="l07422"></a><span class="lineno"> 7422</span>&#160;        <span class="keywordflow">for</span> (var i = 0; i &lt; this._disabledInputs.length; i++) {</div>
<div class="line"><a name="l07423"></a><span class="lineno"> 7423</span>&#160;            <span class="keywordflow">if</span> (this._disabledInputs[i] == target)</div>
<div class="line"><a name="l07424"></a><span class="lineno"> 7424</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l07425"></a><span class="lineno"> 7425</span>&#160;        }</div>
<div class="line"><a name="l07426"></a><span class="lineno"> 7426</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l07427"></a><span class="lineno"> 7427</span>&#160;    },</div>
<div class="line"><a name="l07428"></a><span class="lineno"> 7428</span>&#160;</div>
<div class="line"><a name="l07429"></a><span class="lineno"> 7429</span>&#160;    <span class="comment">/* Retrieve the instance data for the target control.</span></div>
<div class="line"><a name="l07430"></a><span class="lineno"> 7430</span>&#160;<span class="comment">       @param  target  element - the target input field or division or span</span></div>
<div class="line"><a name="l07431"></a><span class="lineno"> 7431</span>&#160;<span class="comment">       @return  object - the associated instance data</span></div>
<div class="line"><a name="l07432"></a><span class="lineno"> 7432</span>&#160;<span class="comment">       @throws  error if a jQuery problem getting data */</span></div>
<div class="line"><a name="l07433"></a><span class="lineno"> 7433</span>&#160;    _getInst: <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l07434"></a><span class="lineno"> 7434</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l07435"></a><span class="lineno"> 7435</span>&#160;            <span class="keywordflow">return</span> $.data(target, PROP_NAME);</div>
<div class="line"><a name="l07436"></a><span class="lineno"> 7436</span>&#160;        }</div>
<div class="line"><a name="l07437"></a><span class="lineno"> 7437</span>&#160;        <span class="keywordflow">catch</span> (err) {</div>
<div class="line"><a name="l07438"></a><span class="lineno"> 7438</span>&#160;            <span class="keywordflow">throw</span> <span class="stringliteral">&#39;Missing instance data for this datepicker&#39;</span>;</div>
<div class="line"><a name="l07439"></a><span class="lineno"> 7439</span>&#160;        }</div>
<div class="line"><a name="l07440"></a><span class="lineno"> 7440</span>&#160;    },</div>
<div class="line"><a name="l07441"></a><span class="lineno"> 7441</span>&#160;</div>
<div class="line"><a name="l07442"></a><span class="lineno"> 7442</span>&#160;    <span class="comment">/* Update or retrieve the settings for a date picker attached to an input field or division.</span></div>
<div class="line"><a name="l07443"></a><span class="lineno"> 7443</span>&#160;<span class="comment">       @param  target  element - the target input field or division or span</span></div>
<div class="line"><a name="l07444"></a><span class="lineno"> 7444</span>&#160;<span class="comment">       @param  name    object - the new settings to update or</span></div>
<div class="line"><a name="l07445"></a><span class="lineno"> 7445</span>&#160;<span class="comment">                       string - the name of the setting to change or retrieve,</span></div>
<div class="line"><a name="l07446"></a><span class="lineno"> 7446</span>&#160;<span class="comment">                       when retrieving also &#39;all&#39; for all instance settings or</span></div>
<div class="line"><a name="l07447"></a><span class="lineno"> 7447</span>&#160;<span class="comment">                       &#39;defaults&#39; for all global defaults</span></div>
<div class="line"><a name="l07448"></a><span class="lineno"> 7448</span>&#160;<span class="comment">       @param  value   any - the new value for the setting</span></div>
<div class="line"><a name="l07449"></a><span class="lineno"> 7449</span>&#160;<span class="comment">                       (omit if above is an object or to retrieve a value) */</span></div>
<div class="line"><a name="l07450"></a><span class="lineno"> 7450</span>&#160;    _optionDatepicker: <span class="keyword">function</span>(target, name, value) {</div>
<div class="line"><a name="l07451"></a><span class="lineno"> 7451</span>&#160;        var inst = this._getInst(target);</div>
<div class="line"><a name="l07452"></a><span class="lineno"> 7452</span>&#160;        <span class="keywordflow">if</span> (arguments.length == 2 &amp;&amp; typeof name == <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l07453"></a><span class="lineno"> 7453</span>&#160;            <span class="keywordflow">return</span> (name == <span class="stringliteral">&#39;defaults&#39;</span> ? $.extend({}, $.datepicker._defaults) :</div>
<div class="line"><a name="l07454"></a><span class="lineno"> 7454</span>&#160;                (inst ? (name == <span class="stringliteral">&#39;all&#39;</span> ? $.extend({}, inst.settings) :</div>
<div class="line"><a name="l07455"></a><span class="lineno"> 7455</span>&#160;                this._get(inst, name)) : null));</div>
<div class="line"><a name="l07456"></a><span class="lineno"> 7456</span>&#160;        }</div>
<div class="line"><a name="l07457"></a><span class="lineno"> 7457</span>&#160;        var settings = name || {};</div>
<div class="line"><a name="l07458"></a><span class="lineno"> 7458</span>&#160;        <span class="keywordflow">if</span> (typeof name == <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l07459"></a><span class="lineno"> 7459</span>&#160;            settings = {};</div>
<div class="line"><a name="l07460"></a><span class="lineno"> 7460</span>&#160;            settings[name] = value;</div>
<div class="line"><a name="l07461"></a><span class="lineno"> 7461</span>&#160;        }</div>
<div class="line"><a name="l07462"></a><span class="lineno"> 7462</span>&#160;        <span class="keywordflow">if</span> (inst) {</div>
<div class="line"><a name="l07463"></a><span class="lineno"> 7463</span>&#160;            <span class="keywordflow">if</span> (this._curInst == inst) {</div>
<div class="line"><a name="l07464"></a><span class="lineno"> 7464</span>&#160;                this._hideDatepicker();</div>
<div class="line"><a name="l07465"></a><span class="lineno"> 7465</span>&#160;            }</div>
<div class="line"><a name="l07466"></a><span class="lineno"> 7466</span>&#160;            var date = this._getDateDatepicker(target, <span class="keyword">true</span>);</div>
<div class="line"><a name="l07467"></a><span class="lineno"> 7467</span>&#160;            var minDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;min&#39;</span>);</div>
<div class="line"><a name="l07468"></a><span class="lineno"> 7468</span>&#160;            var maxDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;max&#39;</span>);</div>
<div class="line"><a name="l07469"></a><span class="lineno"> 7469</span>&#160;            extendRemove(inst.settings, settings);</div>
<div class="line"><a name="l07470"></a><span class="lineno"> 7470</span>&#160;            <span class="comment">// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn&#39;t provided</span></div>
<div class="line"><a name="l07471"></a><span class="lineno"> 7471</span>&#160;            <span class="keywordflow">if</span> (minDate !== null &amp;&amp; settings[<span class="stringliteral">&#39;dateFormat&#39;</span>] !== undefined &amp;&amp; settings[<span class="stringliteral">&#39;minDate&#39;</span>] === undefined)</div>
<div class="line"><a name="l07472"></a><span class="lineno"> 7472</span>&#160;                inst.settings.minDate = this._formatDate(inst, minDate);</div>
<div class="line"><a name="l07473"></a><span class="lineno"> 7473</span>&#160;            <span class="keywordflow">if</span> (maxDate !== null &amp;&amp; settings[<span class="stringliteral">&#39;dateFormat&#39;</span>] !== undefined &amp;&amp; settings[<span class="stringliteral">&#39;maxDate&#39;</span>] === undefined)</div>
<div class="line"><a name="l07474"></a><span class="lineno"> 7474</span>&#160;                inst.settings.maxDate = this._formatDate(inst, maxDate);</div>
<div class="line"><a name="l07475"></a><span class="lineno"> 7475</span>&#160;            this._attachments($(target), inst);</div>
<div class="line"><a name="l07476"></a><span class="lineno"> 7476</span>&#160;            this._autoSize(inst);</div>
<div class="line"><a name="l07477"></a><span class="lineno"> 7477</span>&#160;            this._setDate(inst, date);</div>
<div class="line"><a name="l07478"></a><span class="lineno"> 7478</span>&#160;            this._updateAlternate(inst);</div>
<div class="line"><a name="l07479"></a><span class="lineno"> 7479</span>&#160;            this._updateDatepicker(inst);</div>
<div class="line"><a name="l07480"></a><span class="lineno"> 7480</span>&#160;        }</div>
<div class="line"><a name="l07481"></a><span class="lineno"> 7481</span>&#160;    },</div>
<div class="line"><a name="l07482"></a><span class="lineno"> 7482</span>&#160;</div>
<div class="line"><a name="l07483"></a><span class="lineno"> 7483</span>&#160;    <span class="comment">// change method deprecated</span></div>
<div class="line"><a name="l07484"></a><span class="lineno"> 7484</span>&#160;    _changeDatepicker: <span class="keyword">function</span>(target, name, value) {</div>
<div class="line"><a name="l07485"></a><span class="lineno"> 7485</span>&#160;        this._optionDatepicker(target, name, value);</div>
<div class="line"><a name="l07486"></a><span class="lineno"> 7486</span>&#160;    },</div>
<div class="line"><a name="l07487"></a><span class="lineno"> 7487</span>&#160;</div>
<div class="line"><a name="l07488"></a><span class="lineno"> 7488</span>&#160;    <span class="comment">/* Redraw the date picker attached to an input field or division.</span></div>
<div class="line"><a name="l07489"></a><span class="lineno"> 7489</span>&#160;<span class="comment">       @param  target  element - the target input field or division or span */</span></div>
<div class="line"><a name="l07490"></a><span class="lineno"> 7490</span>&#160;    _refreshDatepicker: <span class="keyword">function</span>(target) {</div>
<div class="line"><a name="l07491"></a><span class="lineno"> 7491</span>&#160;        var inst = this._getInst(target);</div>
<div class="line"><a name="l07492"></a><span class="lineno"> 7492</span>&#160;        <span class="keywordflow">if</span> (inst) {</div>
<div class="line"><a name="l07493"></a><span class="lineno"> 7493</span>&#160;            this._updateDatepicker(inst);</div>
<div class="line"><a name="l07494"></a><span class="lineno"> 7494</span>&#160;        }</div>
<div class="line"><a name="l07495"></a><span class="lineno"> 7495</span>&#160;    },</div>
<div class="line"><a name="l07496"></a><span class="lineno"> 7496</span>&#160;</div>
<div class="line"><a name="l07497"></a><span class="lineno"> 7497</span>&#160;    <span class="comment">/* Set the dates for a jQuery selection.</span></div>
<div class="line"><a name="l07498"></a><span class="lineno"> 7498</span>&#160;<span class="comment">       @param  target   element - the target input field or division or span</span></div>
<div class="line"><a name="l07499"></a><span class="lineno"> 7499</span>&#160;<span class="comment">       @param  date     Date - the new date */</span></div>
<div class="line"><a name="l07500"></a><span class="lineno"> 7500</span>&#160;    _setDateDatepicker: <span class="keyword">function</span>(target, date) {</div>
<div class="line"><a name="l07501"></a><span class="lineno"> 7501</span>&#160;        var inst = this._getInst(target);</div>
<div class="line"><a name="l07502"></a><span class="lineno"> 7502</span>&#160;        <span class="keywordflow">if</span> (inst) {</div>
<div class="line"><a name="l07503"></a><span class="lineno"> 7503</span>&#160;            this._setDate(inst, date);</div>
<div class="line"><a name="l07504"></a><span class="lineno"> 7504</span>&#160;            this._updateDatepicker(inst);</div>
<div class="line"><a name="l07505"></a><span class="lineno"> 7505</span>&#160;            this._updateAlternate(inst);</div>
<div class="line"><a name="l07506"></a><span class="lineno"> 7506</span>&#160;        }</div>
<div class="line"><a name="l07507"></a><span class="lineno"> 7507</span>&#160;    },</div>
<div class="line"><a name="l07508"></a><span class="lineno"> 7508</span>&#160;</div>
<div class="line"><a name="l07509"></a><span class="lineno"> 7509</span>&#160;    <span class="comment">/* Get the date(s) for the first entry in a jQuery selection.</span></div>
<div class="line"><a name="l07510"></a><span class="lineno"> 7510</span>&#160;<span class="comment">       @param  target     element - the target input field or division or span</span></div>
<div class="line"><a name="l07511"></a><span class="lineno"> 7511</span>&#160;<span class="comment">       @param  noDefault  boolean - true if no default date is to be used</span></div>
<div class="line"><a name="l07512"></a><span class="lineno"> 7512</span>&#160;<span class="comment">       @return Date - the current date */</span></div>
<div class="line"><a name="l07513"></a><span class="lineno"> 7513</span>&#160;    _getDateDatepicker: <span class="keyword">function</span>(target, noDefault) {</div>
<div class="line"><a name="l07514"></a><span class="lineno"> 7514</span>&#160;        var inst = this._getInst(target);</div>
<div class="line"><a name="l07515"></a><span class="lineno"> 7515</span>&#160;        <span class="keywordflow">if</span> (inst &amp;&amp; !inst.inline)</div>
<div class="line"><a name="l07516"></a><span class="lineno"> 7516</span>&#160;            this._setDateFromField(inst, noDefault);</div>
<div class="line"><a name="l07517"></a><span class="lineno"> 7517</span>&#160;        <span class="keywordflow">return</span> (inst ? this._getDate(inst) : null);</div>
<div class="line"><a name="l07518"></a><span class="lineno"> 7518</span>&#160;    },</div>
<div class="line"><a name="l07519"></a><span class="lineno"> 7519</span>&#160;</div>
<div class="line"><a name="l07520"></a><span class="lineno"> 7520</span>&#160;    <span class="comment">/* Handle keystrokes. */</span></div>
<div class="line"><a name="l07521"></a><span class="lineno"> 7521</span>&#160;    _doKeyDown: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l07522"></a><span class="lineno"> 7522</span>&#160;        var inst = $.datepicker._getInst(event.target);</div>
<div class="line"><a name="l07523"></a><span class="lineno"> 7523</span>&#160;        var handled = <span class="keyword">true</span>;</div>
<div class="line"><a name="l07524"></a><span class="lineno"> 7524</span>&#160;        var isRTL = inst.dpDiv.is(<span class="stringliteral">&#39;.ui-datepicker-rtl&#39;</span>);</div>
<div class="line"><a name="l07525"></a><span class="lineno"> 7525</span>&#160;        inst._keyEvent = <span class="keyword">true</span>;</div>
<div class="line"><a name="l07526"></a><span class="lineno"> 7526</span>&#160;        <span class="keywordflow">if</span> ($.datepicker._datepickerShowing)</div>
<div class="line"><a name="l07527"></a><span class="lineno"> 7527</span>&#160;            <span class="keywordflow">switch</span> (event.keyCode) {</div>
<div class="line"><a name="l07528"></a><span class="lineno"> 7528</span>&#160;                <span class="keywordflow">case</span> 9: $.datepicker._hideDatepicker();</div>
<div class="line"><a name="l07529"></a><span class="lineno"> 7529</span>&#160;                        handled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07530"></a><span class="lineno"> 7530</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// hide on tab out</span></div>
<div class="line"><a name="l07531"></a><span class="lineno"> 7531</span>&#160;                <span class="keywordflow">case</span> 13: var sel = $(<span class="stringliteral">&#39;td.&#39;</span> + $.datepicker._dayOverClass + <span class="stringliteral">&#39;:not(.&#39;</span> + </div>
<div class="line"><a name="l07532"></a><span class="lineno"> 7532</span>&#160;                                    $.datepicker._currentClass + <span class="charliteral">&#39;)&#39;</span>, inst.dpDiv);</div>
<div class="line"><a name="l07533"></a><span class="lineno"> 7533</span>&#160;                        <span class="keywordflow">if</span> (sel[0])</div>
<div class="line"><a name="l07534"></a><span class="lineno"> 7534</span>&#160;                            $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);</div>
<div class="line"><a name="l07535"></a><span class="lineno"> 7535</span>&#160;                            var onSelect = $.datepicker._get(inst, <span class="stringliteral">&#39;onSelect&#39;</span>);</div>
<div class="line"><a name="l07536"></a><span class="lineno"> 7536</span>&#160;                            <span class="keywordflow">if</span> (onSelect) {</div>
<div class="line"><a name="l07537"></a><span class="lineno"> 7537</span>&#160;                                var dateStr = $.datepicker._formatDate(inst);</div>
<div class="line"><a name="l07538"></a><span class="lineno"> 7538</span>&#160;</div>
<div class="line"><a name="l07539"></a><span class="lineno"> 7539</span>&#160;                                <span class="comment">// trigger custom callback</span></div>
<div class="line"><a name="l07540"></a><span class="lineno"> 7540</span>&#160;                                onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);</div>
<div class="line"><a name="l07541"></a><span class="lineno"> 7541</span>&#160;                            }</div>
<div class="line"><a name="l07542"></a><span class="lineno"> 7542</span>&#160;                        <span class="keywordflow">else</span></div>
<div class="line"><a name="l07543"></a><span class="lineno"> 7543</span>&#160;                            $.datepicker._hideDatepicker();</div>
<div class="line"><a name="l07544"></a><span class="lineno"> 7544</span>&#160;                        <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// don&#39;t submit the form</span></div>
<div class="line"><a name="l07545"></a><span class="lineno"> 7545</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// select the value on enter</span></div>
<div class="line"><a name="l07546"></a><span class="lineno"> 7546</span>&#160;                <span class="keywordflow">case</span> 27: $.datepicker._hideDatepicker();</div>
<div class="line"><a name="l07547"></a><span class="lineno"> 7547</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// hide on escape</span></div>
<div class="line"><a name="l07548"></a><span class="lineno"> 7548</span>&#160;                <span class="keywordflow">case</span> 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?</div>
<div class="line"><a name="l07549"></a><span class="lineno"> 7549</span>&#160;                            -$.datepicker._get(inst, <span class="stringliteral">&#39;stepBigMonths&#39;</span>) :</div>
<div class="line"><a name="l07550"></a><span class="lineno"> 7550</span>&#160;                            -$.datepicker._get(inst, <span class="stringliteral">&#39;stepMonths&#39;</span>)), <span class="charliteral">&#39;M&#39;</span>);</div>
<div class="line"><a name="l07551"></a><span class="lineno"> 7551</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// previous month/year on page up/+ ctrl</span></div>
<div class="line"><a name="l07552"></a><span class="lineno"> 7552</span>&#160;                <span class="keywordflow">case</span> 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?</div>
<div class="line"><a name="l07553"></a><span class="lineno"> 7553</span>&#160;                            +$.datepicker._get(inst, <span class="stringliteral">&#39;stepBigMonths&#39;</span>) :</div>
<div class="line"><a name="l07554"></a><span class="lineno"> 7554</span>&#160;                            +$.datepicker._get(inst, <span class="stringliteral">&#39;stepMonths&#39;</span>)), <span class="charliteral">&#39;M&#39;</span>);</div>
<div class="line"><a name="l07555"></a><span class="lineno"> 7555</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// next month/year on page down/+ ctrl</span></div>
<div class="line"><a name="l07556"></a><span class="lineno"> 7556</span>&#160;                <span class="keywordflow">case</span> 35: <span class="keywordflow">if</span> (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);</div>
<div class="line"><a name="l07557"></a><span class="lineno"> 7557</span>&#160;                        handled = <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey;</div>
<div class="line"><a name="l07558"></a><span class="lineno"> 7558</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// clear on ctrl or command +end</span></div>
<div class="line"><a name="l07559"></a><span class="lineno"> 7559</span>&#160;                <span class="keywordflow">case</span> 36: <span class="keywordflow">if</span> (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);</div>
<div class="line"><a name="l07560"></a><span class="lineno"> 7560</span>&#160;                        handled = <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey;</div>
<div class="line"><a name="l07561"></a><span class="lineno"> 7561</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// current on ctrl or command +home</span></div>
<div class="line"><a name="l07562"></a><span class="lineno"> 7562</span>&#160;                <span class="keywordflow">case</span> 37: <span class="keywordflow">if</span> (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), <span class="charliteral">&#39;D&#39;</span>);</div>
<div class="line"><a name="l07563"></a><span class="lineno"> 7563</span>&#160;                        handled = <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey;</div>
<div class="line"><a name="l07564"></a><span class="lineno"> 7564</span>&#160;                        <span class="comment">// -1 day on ctrl or command +left</span></div>
<div class="line"><a name="l07565"></a><span class="lineno"> 7565</span>&#160;                        <span class="keywordflow">if</span> (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?</div>
<div class="line"><a name="l07566"></a><span class="lineno"> 7566</span>&#160;                                    -$.datepicker._get(inst, <span class="stringliteral">&#39;stepBigMonths&#39;</span>) :</div>
<div class="line"><a name="l07567"></a><span class="lineno"> 7567</span>&#160;                                    -$.datepicker._get(inst, <span class="stringliteral">&#39;stepMonths&#39;</span>)), <span class="charliteral">&#39;M&#39;</span>);</div>
<div class="line"><a name="l07568"></a><span class="lineno"> 7568</span>&#160;                        <span class="comment">// next month/year on alt +left on Mac</span></div>
<div class="line"><a name="l07569"></a><span class="lineno"> 7569</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l07570"></a><span class="lineno"> 7570</span>&#160;                <span class="keywordflow">case</span> 38: <span class="keywordflow">if</span> (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, <span class="charliteral">&#39;D&#39;</span>);</div>
<div class="line"><a name="l07571"></a><span class="lineno"> 7571</span>&#160;                        handled = <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey;</div>
<div class="line"><a name="l07572"></a><span class="lineno"> 7572</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// -1 week on ctrl or command +up</span></div>
<div class="line"><a name="l07573"></a><span class="lineno"> 7573</span>&#160;                <span class="keywordflow">case</span> 39: <span class="keywordflow">if</span> (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), <span class="charliteral">&#39;D&#39;</span>);</div>
<div class="line"><a name="l07574"></a><span class="lineno"> 7574</span>&#160;                        handled = <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey;</div>
<div class="line"><a name="l07575"></a><span class="lineno"> 7575</span>&#160;                        <span class="comment">// +1 day on ctrl or command +right</span></div>
<div class="line"><a name="l07576"></a><span class="lineno"> 7576</span>&#160;                        <span class="keywordflow">if</span> (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?</div>
<div class="line"><a name="l07577"></a><span class="lineno"> 7577</span>&#160;                                    +$.datepicker._get(inst, <span class="stringliteral">&#39;stepBigMonths&#39;</span>) :</div>
<div class="line"><a name="l07578"></a><span class="lineno"> 7578</span>&#160;                                    +$.datepicker._get(inst, <span class="stringliteral">&#39;stepMonths&#39;</span>)), <span class="charliteral">&#39;M&#39;</span>);</div>
<div class="line"><a name="l07579"></a><span class="lineno"> 7579</span>&#160;                        <span class="comment">// next month/year on alt +right</span></div>
<div class="line"><a name="l07580"></a><span class="lineno"> 7580</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l07581"></a><span class="lineno"> 7581</span>&#160;                <span class="keywordflow">case</span> 40: <span class="keywordflow">if</span> (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, <span class="charliteral">&#39;D&#39;</span>);</div>
<div class="line"><a name="l07582"></a><span class="lineno"> 7582</span>&#160;                        handled = <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey;</div>
<div class="line"><a name="l07583"></a><span class="lineno"> 7583</span>&#160;                        <span class="keywordflow">break</span>; <span class="comment">// +1 week on ctrl or command +down</span></div>
<div class="line"><a name="l07584"></a><span class="lineno"> 7584</span>&#160;                <span class="keywordflow">default</span>: handled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07585"></a><span class="lineno"> 7585</span>&#160;            }</div>
<div class="line"><a name="l07586"></a><span class="lineno"> 7586</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event.keyCode == 36 &amp;&amp; event.ctrlKey) <span class="comment">// display the date picker on ctrl+home</span></div>
<div class="line"><a name="l07587"></a><span class="lineno"> 7587</span>&#160;            $.datepicker._showDatepicker(<span class="keyword">this</span>);</div>
<div class="line"><a name="l07588"></a><span class="lineno"> 7588</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l07589"></a><span class="lineno"> 7589</span>&#160;            handled = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07590"></a><span class="lineno"> 7590</span>&#160;        }</div>
<div class="line"><a name="l07591"></a><span class="lineno"> 7591</span>&#160;        <span class="keywordflow">if</span> (handled) {</div>
<div class="line"><a name="l07592"></a><span class="lineno"> 7592</span>&#160;            <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l07593"></a><span class="lineno"> 7593</span>&#160;            <span class="keyword">event</span>.stopPropagation();</div>
<div class="line"><a name="l07594"></a><span class="lineno"> 7594</span>&#160;        }</div>
<div class="line"><a name="l07595"></a><span class="lineno"> 7595</span>&#160;    },</div>
<div class="line"><a name="l07596"></a><span class="lineno"> 7596</span>&#160;</div>
<div class="line"><a name="l07597"></a><span class="lineno"> 7597</span>&#160;    <span class="comment">/* Filter entered characters - based on date format. */</span></div>
<div class="line"><a name="l07598"></a><span class="lineno"> 7598</span>&#160;    _doKeyPress: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l07599"></a><span class="lineno"> 7599</span>&#160;        var inst = $.datepicker._getInst(event.target);</div>
<div class="line"><a name="l07600"></a><span class="lineno"> 7600</span>&#160;        <span class="keywordflow">if</span> ($.datepicker._get(inst, <span class="stringliteral">&#39;constrainInput&#39;</span>)) {</div>
<div class="line"><a name="l07601"></a><span class="lineno"> 7601</span>&#160;            var chars = $.datepicker._possibleChars($.datepicker._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>));</div>
<div class="line"><a name="l07602"></a><span class="lineno"> 7602</span>&#160;            var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);</div>
<div class="line"><a name="l07603"></a><span class="lineno"> 7603</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">event</span>.ctrlKey || <span class="keyword">event</span>.metaKey || (chr &lt; <span class="charliteral">&#39; &#39;</span> || !chars || chars.indexOf(chr) &gt; -1);</div>
<div class="line"><a name="l07604"></a><span class="lineno"> 7604</span>&#160;        }</div>
<div class="line"><a name="l07605"></a><span class="lineno"> 7605</span>&#160;    },</div>
<div class="line"><a name="l07606"></a><span class="lineno"> 7606</span>&#160;</div>
<div class="line"><a name="l07607"></a><span class="lineno"> 7607</span>&#160;    <span class="comment">/* Synchronise manual entry and field/alternate field. */</span></div>
<div class="line"><a name="l07608"></a><span class="lineno"> 7608</span>&#160;    _doKeyUp: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l07609"></a><span class="lineno"> 7609</span>&#160;        var inst = $.datepicker._getInst(event.target);</div>
<div class="line"><a name="l07610"></a><span class="lineno"> 7610</span>&#160;        <span class="keywordflow">if</span> (inst.input.val() != inst.lastVal) {</div>
<div class="line"><a name="l07611"></a><span class="lineno"> 7611</span>&#160;            <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l07612"></a><span class="lineno"> 7612</span>&#160;                var date = $.datepicker.parseDate($.datepicker._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>),</div>
<div class="line"><a name="l07613"></a><span class="lineno"> 7613</span>&#160;                    (inst.input ? inst.input.val() : null),</div>
<div class="line"><a name="l07614"></a><span class="lineno"> 7614</span>&#160;                    $.datepicker._getFormatConfig(inst));</div>
<div class="line"><a name="l07615"></a><span class="lineno"> 7615</span>&#160;                <span class="keywordflow">if</span> (date) { <span class="comment">// only if valid</span></div>
<div class="line"><a name="l07616"></a><span class="lineno"> 7616</span>&#160;                    $.datepicker._setDateFromField(inst);</div>
<div class="line"><a name="l07617"></a><span class="lineno"> 7617</span>&#160;                    $.datepicker._updateAlternate(inst);</div>
<div class="line"><a name="l07618"></a><span class="lineno"> 7618</span>&#160;                    $.datepicker._updateDatepicker(inst);</div>
<div class="line"><a name="l07619"></a><span class="lineno"> 7619</span>&#160;                }</div>
<div class="line"><a name="l07620"></a><span class="lineno"> 7620</span>&#160;            }</div>
<div class="line"><a name="l07621"></a><span class="lineno"> 7621</span>&#160;            <span class="keywordflow">catch</span> (err) {</div>
<div class="line"><a name="l07622"></a><span class="lineno"> 7622</span>&#160;                $.datepicker.log(err);</div>
<div class="line"><a name="l07623"></a><span class="lineno"> 7623</span>&#160;            }</div>
<div class="line"><a name="l07624"></a><span class="lineno"> 7624</span>&#160;        }</div>
<div class="line"><a name="l07625"></a><span class="lineno"> 7625</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l07626"></a><span class="lineno"> 7626</span>&#160;    },</div>
<div class="line"><a name="l07627"></a><span class="lineno"> 7627</span>&#160;</div>
<div class="line"><a name="l07628"></a><span class="lineno"> 7628</span>&#160;    <span class="comment">/* Pop-up the date picker for a given input field.</span></div>
<div class="line"><a name="l07629"></a><span class="lineno"> 7629</span>&#160;<span class="comment">       If false returned from beforeShow event handler do not show. </span></div>
<div class="line"><a name="l07630"></a><span class="lineno"> 7630</span>&#160;<span class="comment">       @param  input  element - the input field attached to the date picker or</span></div>
<div class="line"><a name="l07631"></a><span class="lineno"> 7631</span>&#160;<span class="comment">                      event - if triggered by focus */</span></div>
<div class="line"><a name="l07632"></a><span class="lineno"> 7632</span>&#160;    _showDatepicker: <span class="keyword">function</span>(input) {</div>
<div class="line"><a name="l07633"></a><span class="lineno"> 7633</span>&#160;        input = input.target || input;</div>
<div class="line"><a name="l07634"></a><span class="lineno"> 7634</span>&#160;        <span class="keywordflow">if</span> (input.nodeName.toLowerCase() != <span class="stringliteral">&#39;input&#39;</span>) <span class="comment">// find from button/image trigger</span></div>
<div class="line"><a name="l07635"></a><span class="lineno"> 7635</span>&#160;            input = $(<span class="stringliteral">&#39;input&#39;</span>, input.parentNode)[0];</div>
<div class="line"><a name="l07636"></a><span class="lineno"> 7636</span>&#160;        <span class="keywordflow">if</span> ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) <span class="comment">// already here</span></div>
<div class="line"><a name="l07637"></a><span class="lineno"> 7637</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07638"></a><span class="lineno"> 7638</span>&#160;        var inst = $.datepicker._getInst(input);</div>
<div class="line"><a name="l07639"></a><span class="lineno"> 7639</span>&#160;        <span class="keywordflow">if</span> ($.datepicker._curInst &amp;&amp; $.datepicker._curInst != inst) {</div>
<div class="line"><a name="l07640"></a><span class="lineno"> 7640</span>&#160;            $.datepicker._curInst.dpDiv.stop(<span class="keyword">true</span>, <span class="keyword">true</span>);</div>
<div class="line"><a name="l07641"></a><span class="lineno"> 7641</span>&#160;            <span class="keywordflow">if</span> ( inst &amp;&amp; $.datepicker._datepickerShowing ) {</div>
<div class="line"><a name="l07642"></a><span class="lineno"> 7642</span>&#160;                $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );</div>
<div class="line"><a name="l07643"></a><span class="lineno"> 7643</span>&#160;            }</div>
<div class="line"><a name="l07644"></a><span class="lineno"> 7644</span>&#160;        }</div>
<div class="line"><a name="l07645"></a><span class="lineno"> 7645</span>&#160;        var beforeShow = $.datepicker._get(inst, <span class="stringliteral">&#39;beforeShow&#39;</span>);</div>
<div class="line"><a name="l07646"></a><span class="lineno"> 7646</span>&#160;        var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};</div>
<div class="line"><a name="l07647"></a><span class="lineno"> 7647</span>&#160;        <span class="keywordflow">if</span>(beforeShowSettings === <span class="keyword">false</span>){</div>
<div class="line"><a name="l07648"></a><span class="lineno"> 7648</span>&#160;            <span class="comment">//false</span></div>
<div class="line"><a name="l07649"></a><span class="lineno"> 7649</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07650"></a><span class="lineno"> 7650</span>&#160;        }</div>
<div class="line"><a name="l07651"></a><span class="lineno"> 7651</span>&#160;        extendRemove(inst.settings, beforeShowSettings);</div>
<div class="line"><a name="l07652"></a><span class="lineno"> 7652</span>&#160;        inst.lastVal = null;</div>
<div class="line"><a name="l07653"></a><span class="lineno"> 7653</span>&#160;        $.datepicker._lastInput = input;</div>
<div class="line"><a name="l07654"></a><span class="lineno"> 7654</span>&#160;        $.datepicker._setDateFromField(inst);</div>
<div class="line"><a name="l07655"></a><span class="lineno"> 7655</span>&#160;        <span class="keywordflow">if</span> ($.datepicker._inDialog) <span class="comment">// hide cursor</span></div>
<div class="line"><a name="l07656"></a><span class="lineno"> 7656</span>&#160;            input.value = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l07657"></a><span class="lineno"> 7657</span>&#160;        <span class="keywordflow">if</span> (!$.datepicker._pos) { <span class="comment">// position below input</span></div>
<div class="line"><a name="l07658"></a><span class="lineno"> 7658</span>&#160;            $.datepicker._pos = $.datepicker._findPos(input);</div>
<div class="line"><a name="l07659"></a><span class="lineno"> 7659</span>&#160;            $.datepicker._pos[1] += input.offsetHeight; <span class="comment">// add the height</span></div>
<div class="line"><a name="l07660"></a><span class="lineno"> 7660</span>&#160;        }</div>
<div class="line"><a name="l07661"></a><span class="lineno"> 7661</span>&#160;        var isFixed = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07662"></a><span class="lineno"> 7662</span>&#160;        $(input).parents().each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l07663"></a><span class="lineno"> 7663</span>&#160;            isFixed |= $(<span class="keyword">this</span>).css(<span class="stringliteral">&#39;position&#39;</span>) == <span class="stringliteral">&#39;fixed&#39;</span>;</div>
<div class="line"><a name="l07664"></a><span class="lineno"> 7664</span>&#160;            <span class="keywordflow">return</span> !isFixed;</div>
<div class="line"><a name="l07665"></a><span class="lineno"> 7665</span>&#160;        });</div>
<div class="line"><a name="l07666"></a><span class="lineno"> 7666</span>&#160;        <span class="keywordflow">if</span> (isFixed &amp;&amp; $.browser.opera) { <span class="comment">// correction for Opera when fixed and scrolled</span></div>
<div class="line"><a name="l07667"></a><span class="lineno"> 7667</span>&#160;            $.datepicker._pos[0] -= document.documentElement.scrollLeft;</div>
<div class="line"><a name="l07668"></a><span class="lineno"> 7668</span>&#160;            $.datepicker._pos[1] -= document.documentElement.scrollTop;</div>
<div class="line"><a name="l07669"></a><span class="lineno"> 7669</span>&#160;        }</div>
<div class="line"><a name="l07670"></a><span class="lineno"> 7670</span>&#160;        var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};</div>
<div class="line"><a name="l07671"></a><span class="lineno"> 7671</span>&#160;        $.datepicker._pos = null;</div>
<div class="line"><a name="l07672"></a><span class="lineno"> 7672</span>&#160;        <span class="comment">//to avoid flashes on Firefox</span></div>
<div class="line"><a name="l07673"></a><span class="lineno"> 7673</span>&#160;        inst.dpDiv.empty();</div>
<div class="line"><a name="l07674"></a><span class="lineno"> 7674</span>&#160;        <span class="comment">// determine sizing offscreen</span></div>
<div class="line"><a name="l07675"></a><span class="lineno"> 7675</span>&#160;        inst.dpDiv.css({position: <span class="stringliteral">&#39;absolute&#39;</span>, display: <span class="stringliteral">&#39;block&#39;</span>, top: <span class="stringliteral">&#39;-1000px&#39;</span>});</div>
<div class="line"><a name="l07676"></a><span class="lineno"> 7676</span>&#160;        $.datepicker._updateDatepicker(inst);</div>
<div class="line"><a name="l07677"></a><span class="lineno"> 7677</span>&#160;        <span class="comment">// fix width for dynamic number of date pickers</span></div>
<div class="line"><a name="l07678"></a><span class="lineno"> 7678</span>&#160;        <span class="comment">// and adjust position before showing</span></div>
<div class="line"><a name="l07679"></a><span class="lineno"> 7679</span>&#160;        offset = $.datepicker._checkOffset(inst, offset, isFixed);</div>
<div class="line"><a name="l07680"></a><span class="lineno"> 7680</span>&#160;        inst.dpDiv.css({position: ($.datepicker._inDialog &amp;&amp; $.blockUI ?</div>
<div class="line"><a name="l07681"></a><span class="lineno"> 7681</span>&#160;            <span class="stringliteral">&#39;static&#39;</span> : (isFixed ? <span class="stringliteral">&#39;fixed&#39;</span> : <span class="stringliteral">&#39;absolute&#39;</span>)), display: <span class="stringliteral">&#39;none&#39;</span>,</div>
<div class="line"><a name="l07682"></a><span class="lineno"> 7682</span>&#160;            left: offset.left + <span class="stringliteral">&#39;px&#39;</span>, top: offset.top + <span class="stringliteral">&#39;px&#39;</span>});</div>
<div class="line"><a name="l07683"></a><span class="lineno"> 7683</span>&#160;        <span class="keywordflow">if</span> (!inst.inline) {</div>
<div class="line"><a name="l07684"></a><span class="lineno"> 7684</span>&#160;            var showAnim = $.datepicker._get(inst, <span class="stringliteral">&#39;showAnim&#39;</span>);</div>
<div class="line"><a name="l07685"></a><span class="lineno"> 7685</span>&#160;            var duration = $.datepicker._get(inst, <span class="stringliteral">&#39;duration&#39;</span>);</div>
<div class="line"><a name="l07686"></a><span class="lineno"> 7686</span>&#160;            var postProcess = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l07687"></a><span class="lineno"> 7687</span>&#160;                var cover = inst.dpDiv.find(<span class="stringliteral">&#39;iframe.ui-datepicker-cover&#39;</span>); <span class="comment">// IE6- only</span></div>
<div class="line"><a name="l07688"></a><span class="lineno"> 7688</span>&#160;                <span class="keywordflow">if</span>( !! cover.length ){</div>
<div class="line"><a name="l07689"></a><span class="lineno"> 7689</span>&#160;                    var borders = $.datepicker._getBorders(inst.dpDiv);</div>
<div class="line"><a name="l07690"></a><span class="lineno"> 7690</span>&#160;                    cover.css({left: -borders[0], top: -borders[1],</div>
<div class="line"><a name="l07691"></a><span class="lineno"> 7691</span>&#160;                        width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});</div>
<div class="line"><a name="l07692"></a><span class="lineno"> 7692</span>&#160;                }</div>
<div class="line"><a name="l07693"></a><span class="lineno"> 7693</span>&#160;            };</div>
<div class="line"><a name="l07694"></a><span class="lineno"> 7694</span>&#160;            inst.dpDiv.zIndex($(input).zIndex()+1);</div>
<div class="line"><a name="l07695"></a><span class="lineno"> 7695</span>&#160;            $.datepicker._datepickerShowing = <span class="keyword">true</span>;</div>
<div class="line"><a name="l07696"></a><span class="lineno"> 7696</span>&#160;            <span class="keywordflow">if</span> ($.effects &amp;&amp; $.effects[showAnim])</div>
<div class="line"><a name="l07697"></a><span class="lineno"> 7697</span>&#160;                inst.dpDiv.show(showAnim, $.datepicker._get(inst, <span class="stringliteral">&#39;showOptions&#39;</span>), duration, postProcess);</div>
<div class="line"><a name="l07698"></a><span class="lineno"> 7698</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l07699"></a><span class="lineno"> 7699</span>&#160;                inst.dpDiv[showAnim || <span class="stringliteral">&#39;show&#39;</span>]((showAnim ? duration : null), postProcess);</div>
<div class="line"><a name="l07700"></a><span class="lineno"> 7700</span>&#160;            <span class="keywordflow">if</span> (!showAnim || !duration)</div>
<div class="line"><a name="l07701"></a><span class="lineno"> 7701</span>&#160;                postProcess();</div>
<div class="line"><a name="l07702"></a><span class="lineno"> 7702</span>&#160;            <span class="keywordflow">if</span> (inst.input.is(<span class="stringliteral">&#39;:visible&#39;</span>) &amp;&amp; !inst.input.is(<span class="stringliteral">&#39;:disabled&#39;</span>))</div>
<div class="line"><a name="l07703"></a><span class="lineno"> 7703</span>&#160;                inst.input.focus();</div>
<div class="line"><a name="l07704"></a><span class="lineno"> 7704</span>&#160;            $.datepicker._curInst = inst;</div>
<div class="line"><a name="l07705"></a><span class="lineno"> 7705</span>&#160;        }</div>
<div class="line"><a name="l07706"></a><span class="lineno"> 7706</span>&#160;    },</div>
<div class="line"><a name="l07707"></a><span class="lineno"> 7707</span>&#160;</div>
<div class="line"><a name="l07708"></a><span class="lineno"> 7708</span>&#160;    <span class="comment">/* Generate the date picker content. */</span></div>
<div class="line"><a name="l07709"></a><span class="lineno"> 7709</span>&#160;    _updateDatepicker: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l07710"></a><span class="lineno"> 7710</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l07711"></a><span class="lineno"> 7711</span>&#160;        <span class="keyword">self</span>.maxRows = 4; <span class="comment">//Reset the max number of rows being displayed (see #7043)</span></div>
<div class="line"><a name="l07712"></a><span class="lineno"> 7712</span>&#160;        var borders = $.datepicker._getBorders(inst.dpDiv);</div>
<div class="line"><a name="l07713"></a><span class="lineno"> 7713</span>&#160;        instActive = inst; <span class="comment">// for delegate hover events</span></div>
<div class="line"><a name="l07714"></a><span class="lineno"> 7714</span>&#160;        inst.dpDiv.empty().append(this._generateHTML(inst));</div>
<div class="line"><a name="l07715"></a><span class="lineno"> 7715</span>&#160;        var cover = inst.dpDiv.find(<span class="stringliteral">&#39;iframe.ui-datepicker-cover&#39;</span>); <span class="comment">// IE6- only</span></div>
<div class="line"><a name="l07716"></a><span class="lineno"> 7716</span>&#160;        <span class="keywordflow">if</span>( !!cover.length ){ <span class="comment">//avoid call to outerXXXX() when not in IE6</span></div>
<div class="line"><a name="l07717"></a><span class="lineno"> 7717</span>&#160;            cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})</div>
<div class="line"><a name="l07718"></a><span class="lineno"> 7718</span>&#160;        }</div>
<div class="line"><a name="l07719"></a><span class="lineno"> 7719</span>&#160;        inst.dpDiv.find(<span class="charliteral">&#39;.&#39;</span> + <span class="keyword">this</span>._dayOverClass + <span class="stringliteral">&#39; a&#39;</span>).mouseover();</div>
<div class="line"><a name="l07720"></a><span class="lineno"> 7720</span>&#160;        var numMonths = this._getNumberOfMonths(inst);</div>
<div class="line"><a name="l07721"></a><span class="lineno"> 7721</span>&#160;        var cols = numMonths[1];</div>
<div class="line"><a name="l07722"></a><span class="lineno"> 7722</span>&#160;        var width = 17;</div>
<div class="line"><a name="l07723"></a><span class="lineno"> 7723</span>&#160;        inst.dpDiv.removeClass(<span class="stringliteral">&#39;ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4&#39;</span>).width(<span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l07724"></a><span class="lineno"> 7724</span>&#160;        <span class="keywordflow">if</span> (cols &gt; 1)</div>
<div class="line"><a name="l07725"></a><span class="lineno"> 7725</span>&#160;            inst.dpDiv.addClass(<span class="stringliteral">&#39;ui-datepicker-multi-&#39;</span> + cols).css(<span class="stringliteral">&#39;width&#39;</span>, (width * cols) + <span class="stringliteral">&#39;em&#39;</span>);</div>
<div class="line"><a name="l07726"></a><span class="lineno"> 7726</span>&#160;        inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? <span class="stringliteral">&#39;add&#39;</span> : <span class="stringliteral">&#39;remove&#39;</span>) +</div>
<div class="line"><a name="l07727"></a><span class="lineno"> 7727</span>&#160;            <span class="stringliteral">&#39;Class&#39;</span>](<span class="stringliteral">&#39;ui-datepicker-multi&#39;</span>);</div>
<div class="line"><a name="l07728"></a><span class="lineno"> 7728</span>&#160;        inst.dpDiv[(this._get(inst, <span class="stringliteral">&#39;isRTL&#39;</span>) ? <span class="stringliteral">&#39;add&#39;</span> : <span class="stringliteral">&#39;remove&#39;</span>) +</div>
<div class="line"><a name="l07729"></a><span class="lineno"> 7729</span>&#160;            <span class="stringliteral">&#39;Class&#39;</span>](<span class="stringliteral">&#39;ui-datepicker-rtl&#39;</span>);</div>
<div class="line"><a name="l07730"></a><span class="lineno"> 7730</span>&#160;        <span class="keywordflow">if</span> (inst == $.datepicker._curInst &amp;&amp; $.datepicker._datepickerShowing &amp;&amp; inst.input &amp;&amp;</div>
<div class="line"><a name="l07731"></a><span class="lineno"> 7731</span>&#160;                <span class="comment">// #6694 - don&#39;t focus the input if it&#39;s already focused</span></div>
<div class="line"><a name="l07732"></a><span class="lineno"> 7732</span>&#160;                <span class="comment">// this breaks the change event in IE</span></div>
<div class="line"><a name="l07733"></a><span class="lineno"> 7733</span>&#160;                inst.input.is(<span class="stringliteral">&#39;:visible&#39;</span>) &amp;&amp; !inst.input.is(<span class="stringliteral">&#39;:disabled&#39;</span>) &amp;&amp; inst.input[0] != document.activeElement)</div>
<div class="line"><a name="l07734"></a><span class="lineno"> 7734</span>&#160;            inst.input.focus();</div>
<div class="line"><a name="l07735"></a><span class="lineno"> 7735</span>&#160;        <span class="comment">// deffered render of the years select (to avoid flashes on Firefox) </span></div>
<div class="line"><a name="l07736"></a><span class="lineno"> 7736</span>&#160;        <span class="keywordflow">if</span>( inst.yearshtml ){</div>
<div class="line"><a name="l07737"></a><span class="lineno"> 7737</span>&#160;            var origyearshtml = inst.yearshtml;</div>
<div class="line"><a name="l07738"></a><span class="lineno"> 7738</span>&#160;            setTimeout(<span class="keyword">function</span>(){</div>
<div class="line"><a name="l07739"></a><span class="lineno"> 7739</span>&#160;                <span class="comment">//assure that inst.yearshtml didn&#39;t change.</span></div>
<div class="line"><a name="l07740"></a><span class="lineno"> 7740</span>&#160;                <span class="keywordflow">if</span>( origyearshtml === inst.yearshtml &amp;&amp; inst.yearshtml ){</div>
<div class="line"><a name="l07741"></a><span class="lineno"> 7741</span>&#160;                    inst.dpDiv.find(<span class="stringliteral">&#39;select.ui-datepicker-year:first&#39;</span>).replaceWith(inst.yearshtml);</div>
<div class="line"><a name="l07742"></a><span class="lineno"> 7742</span>&#160;                }</div>
<div class="line"><a name="l07743"></a><span class="lineno"> 7743</span>&#160;                origyearshtml = inst.yearshtml = null;</div>
<div class="line"><a name="l07744"></a><span class="lineno"> 7744</span>&#160;            }, 0);</div>
<div class="line"><a name="l07745"></a><span class="lineno"> 7745</span>&#160;        }</div>
<div class="line"><a name="l07746"></a><span class="lineno"> 7746</span>&#160;    },</div>
<div class="line"><a name="l07747"></a><span class="lineno"> 7747</span>&#160;</div>
<div class="line"><a name="l07748"></a><span class="lineno"> 7748</span>&#160;    <span class="comment">/* Retrieve the size of left and top borders for an element.</span></div>
<div class="line"><a name="l07749"></a><span class="lineno"> 7749</span>&#160;<span class="comment">       @param  elem  (jQuery object) the element of interest</span></div>
<div class="line"><a name="l07750"></a><span class="lineno"> 7750</span>&#160;<span class="comment">       @return  (number[2]) the left and top borders */</span></div>
<div class="line"><a name="l07751"></a><span class="lineno"> 7751</span>&#160;    _getBorders: <span class="keyword">function</span>(elem) {</div>
<div class="line"><a name="l07752"></a><span class="lineno"> 7752</span>&#160;        var convert = <span class="keyword">function</span>(value) {</div>
<div class="line"><a name="l07753"></a><span class="lineno"> 7753</span>&#160;            <span class="keywordflow">return</span> {thin: 1, medium: 2, thick: 3}[value] || value;</div>
<div class="line"><a name="l07754"></a><span class="lineno"> 7754</span>&#160;        };</div>
<div class="line"><a name="l07755"></a><span class="lineno"> 7755</span>&#160;        <span class="keywordflow">return</span> [parseFloat(convert(elem.css(<span class="stringliteral">&#39;border-left-width&#39;</span>))),</div>
<div class="line"><a name="l07756"></a><span class="lineno"> 7756</span>&#160;            parseFloat(convert(elem.css(<span class="stringliteral">&#39;border-top-width&#39;</span>)))];</div>
<div class="line"><a name="l07757"></a><span class="lineno"> 7757</span>&#160;    },</div>
<div class="line"><a name="l07758"></a><span class="lineno"> 7758</span>&#160;</div>
<div class="line"><a name="l07759"></a><span class="lineno"> 7759</span>&#160;    <span class="comment">/* Check positioning to remain on screen. */</span></div>
<div class="line"><a name="l07760"></a><span class="lineno"> 7760</span>&#160;    _checkOffset: <span class="keyword">function</span>(inst, offset, isFixed) {</div>
<div class="line"><a name="l07761"></a><span class="lineno"> 7761</span>&#160;        var dpWidth = inst.dpDiv.outerWidth();</div>
<div class="line"><a name="l07762"></a><span class="lineno"> 7762</span>&#160;        var dpHeight = inst.dpDiv.outerHeight();</div>
<div class="line"><a name="l07763"></a><span class="lineno"> 7763</span>&#160;        var inputWidth = inst.input ? inst.input.outerWidth() : 0;</div>
<div class="line"><a name="l07764"></a><span class="lineno"> 7764</span>&#160;        var inputHeight = inst.input ? inst.input.outerHeight() : 0;</div>
<div class="line"><a name="l07765"></a><span class="lineno"> 7765</span>&#160;        var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();</div>
<div class="line"><a name="l07766"></a><span class="lineno"> 7766</span>&#160;        var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();</div>
<div class="line"><a name="l07767"></a><span class="lineno"> 7767</span>&#160;</div>
<div class="line"><a name="l07768"></a><span class="lineno"> 7768</span>&#160;        offset.left -= (this._get(inst, <span class="stringliteral">&#39;isRTL&#39;</span>) ? (dpWidth - inputWidth) : 0);</div>
<div class="line"><a name="l07769"></a><span class="lineno"> 7769</span>&#160;        offset.left -= (isFixed &amp;&amp; offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;</div>
<div class="line"><a name="l07770"></a><span class="lineno"> 7770</span>&#160;        offset.top -= (isFixed &amp;&amp; offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;</div>
<div class="line"><a name="l07771"></a><span class="lineno"> 7771</span>&#160;</div>
<div class="line"><a name="l07772"></a><span class="lineno"> 7772</span>&#160;        <span class="comment">// now check if datepicker is showing outside window viewport - move to a better place if so.</span></div>
<div class="line"><a name="l07773"></a><span class="lineno"> 7773</span>&#160;        offset.left -= Math.min(offset.left, (offset.left + dpWidth &gt; viewWidth &amp;&amp; viewWidth &gt; dpWidth) ?</div>
<div class="line"><a name="l07774"></a><span class="lineno"> 7774</span>&#160;            Math.abs(offset.left + dpWidth - viewWidth) : 0);</div>
<div class="line"><a name="l07775"></a><span class="lineno"> 7775</span>&#160;        offset.top -= Math.min(offset.top, (offset.top + dpHeight &gt; viewHeight &amp;&amp; viewHeight &gt; dpHeight) ?</div>
<div class="line"><a name="l07776"></a><span class="lineno"> 7776</span>&#160;            Math.abs(dpHeight + inputHeight) : 0);</div>
<div class="line"><a name="l07777"></a><span class="lineno"> 7777</span>&#160;</div>
<div class="line"><a name="l07778"></a><span class="lineno"> 7778</span>&#160;        <span class="keywordflow">return</span> offset;</div>
<div class="line"><a name="l07779"></a><span class="lineno"> 7779</span>&#160;    },</div>
<div class="line"><a name="l07780"></a><span class="lineno"> 7780</span>&#160;</div>
<div class="line"><a name="l07781"></a><span class="lineno"> 7781</span>&#160;    <span class="comment">/* Find an object&#39;s position on the screen. */</span></div>
<div class="line"><a name="l07782"></a><span class="lineno"> 7782</span>&#160;    _findPos: <span class="keyword">function</span>(obj) {</div>
<div class="line"><a name="l07783"></a><span class="lineno"> 7783</span>&#160;        var inst = this._getInst(obj);</div>
<div class="line"><a name="l07784"></a><span class="lineno"> 7784</span>&#160;        var isRTL = this._get(inst, <span class="stringliteral">&#39;isRTL&#39;</span>);</div>
<div class="line"><a name="l07785"></a><span class="lineno"> 7785</span>&#160;        <span class="keywordflow">while</span> (obj &amp;&amp; (obj.type == <span class="stringliteral">&#39;hidden&#39;</span> || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {</div>
<div class="line"><a name="l07786"></a><span class="lineno"> 7786</span>&#160;            obj = obj[isRTL ? <span class="stringliteral">&#39;previousSibling&#39;</span> : <span class="stringliteral">&#39;nextSibling&#39;</span>];</div>
<div class="line"><a name="l07787"></a><span class="lineno"> 7787</span>&#160;        }</div>
<div class="line"><a name="l07788"></a><span class="lineno"> 7788</span>&#160;        var position = $(obj).offset();</div>
<div class="line"><a name="l07789"></a><span class="lineno"> 7789</span>&#160;        <span class="keywordflow">return</span> [position.left, position.top];</div>
<div class="line"><a name="l07790"></a><span class="lineno"> 7790</span>&#160;    },</div>
<div class="line"><a name="l07791"></a><span class="lineno"> 7791</span>&#160;</div>
<div class="line"><a name="l07792"></a><span class="lineno"> 7792</span>&#160;    <span class="comment">/* Hide the date picker from view.</span></div>
<div class="line"><a name="l07793"></a><span class="lineno"> 7793</span>&#160;<span class="comment">       @param  input  element - the input field attached to the date picker */</span></div>
<div class="line"><a name="l07794"></a><span class="lineno"> 7794</span>&#160;    _hideDatepicker: <span class="keyword">function</span>(input) {</div>
<div class="line"><a name="l07795"></a><span class="lineno"> 7795</span>&#160;        var inst = this._curInst;</div>
<div class="line"><a name="l07796"></a><span class="lineno"> 7796</span>&#160;        <span class="keywordflow">if</span> (!inst || (input &amp;&amp; inst != $.data(input, PROP_NAME)))</div>
<div class="line"><a name="l07797"></a><span class="lineno"> 7797</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07798"></a><span class="lineno"> 7798</span>&#160;        <span class="keywordflow">if</span> (this._datepickerShowing) {</div>
<div class="line"><a name="l07799"></a><span class="lineno"> 7799</span>&#160;            var showAnim = this._get(inst, <span class="stringliteral">&#39;showAnim&#39;</span>);</div>
<div class="line"><a name="l07800"></a><span class="lineno"> 7800</span>&#160;            var duration = this._get(inst, <span class="stringliteral">&#39;duration&#39;</span>);</div>
<div class="line"><a name="l07801"></a><span class="lineno"> 7801</span>&#160;            var postProcess = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l07802"></a><span class="lineno"> 7802</span>&#160;                $.datepicker._tidyDialog(inst);</div>
<div class="line"><a name="l07803"></a><span class="lineno"> 7803</span>&#160;            };</div>
<div class="line"><a name="l07804"></a><span class="lineno"> 7804</span>&#160;            <span class="keywordflow">if</span> ($.effects &amp;&amp; $.effects[showAnim])</div>
<div class="line"><a name="l07805"></a><span class="lineno"> 7805</span>&#160;                inst.dpDiv.hide(showAnim, $.datepicker._get(inst, <span class="stringliteral">&#39;showOptions&#39;</span>), duration, postProcess);</div>
<div class="line"><a name="l07806"></a><span class="lineno"> 7806</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l07807"></a><span class="lineno"> 7807</span>&#160;                inst.dpDiv[(showAnim == <span class="stringliteral">&#39;slideDown&#39;</span> ? <span class="stringliteral">&#39;slideUp&#39;</span> :</div>
<div class="line"><a name="l07808"></a><span class="lineno"> 7808</span>&#160;                    (showAnim == <span class="stringliteral">&#39;fadeIn&#39;</span> ? <span class="stringliteral">&#39;fadeOut&#39;</span> : <span class="stringliteral">&#39;hide&#39;</span>))]((showAnim ? duration : null), postProcess);</div>
<div class="line"><a name="l07809"></a><span class="lineno"> 7809</span>&#160;            <span class="keywordflow">if</span> (!showAnim)</div>
<div class="line"><a name="l07810"></a><span class="lineno"> 7810</span>&#160;                postProcess();</div>
<div class="line"><a name="l07811"></a><span class="lineno"> 7811</span>&#160;            this._datepickerShowing = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07812"></a><span class="lineno"> 7812</span>&#160;            var onClose = this._get(inst, <span class="stringliteral">&#39;onClose&#39;</span>);</div>
<div class="line"><a name="l07813"></a><span class="lineno"> 7813</span>&#160;            <span class="keywordflow">if</span> (onClose)</div>
<div class="line"><a name="l07814"></a><span class="lineno"> 7814</span>&#160;                onClose.apply((inst.input ? inst.input[0] : null),</div>
<div class="line"><a name="l07815"></a><span class="lineno"> 7815</span>&#160;                    [(inst.input ? inst.input.val() : <span class="stringliteral">&#39;&#39;</span>), inst]);</div>
<div class="line"><a name="l07816"></a><span class="lineno"> 7816</span>&#160;            this._lastInput = null;</div>
<div class="line"><a name="l07817"></a><span class="lineno"> 7817</span>&#160;            <span class="keywordflow">if</span> (this._inDialog) {</div>
<div class="line"><a name="l07818"></a><span class="lineno"> 7818</span>&#160;                this._dialogInput.css({ position: <span class="stringliteral">&#39;absolute&#39;</span>, left: <span class="charliteral">&#39;0&#39;</span>, top: <span class="stringliteral">&#39;-100px&#39;</span> });</div>
<div class="line"><a name="l07819"></a><span class="lineno"> 7819</span>&#160;                <span class="keywordflow">if</span> ($.blockUI) {</div>
<div class="line"><a name="l07820"></a><span class="lineno"> 7820</span>&#160;                    $.unblockUI();</div>
<div class="line"><a name="l07821"></a><span class="lineno"> 7821</span>&#160;                    $(<span class="stringliteral">&#39;body&#39;</span>).append(this.dpDiv);</div>
<div class="line"><a name="l07822"></a><span class="lineno"> 7822</span>&#160;                }</div>
<div class="line"><a name="l07823"></a><span class="lineno"> 7823</span>&#160;            }</div>
<div class="line"><a name="l07824"></a><span class="lineno"> 7824</span>&#160;            this._inDialog = <span class="keyword">false</span>;</div>
<div class="line"><a name="l07825"></a><span class="lineno"> 7825</span>&#160;        }</div>
<div class="line"><a name="l07826"></a><span class="lineno"> 7826</span>&#160;    },</div>
<div class="line"><a name="l07827"></a><span class="lineno"> 7827</span>&#160;</div>
<div class="line"><a name="l07828"></a><span class="lineno"> 7828</span>&#160;    <span class="comment">/* Tidy up after a dialog display. */</span></div>
<div class="line"><a name="l07829"></a><span class="lineno"> 7829</span>&#160;    _tidyDialog: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l07830"></a><span class="lineno"> 7830</span>&#160;        inst.dpDiv.removeClass(this._dialogClass).unbind(<span class="stringliteral">&#39;.ui-datepicker-calendar&#39;</span>);</div>
<div class="line"><a name="l07831"></a><span class="lineno"> 7831</span>&#160;    },</div>
<div class="line"><a name="l07832"></a><span class="lineno"> 7832</span>&#160;</div>
<div class="line"><a name="l07833"></a><span class="lineno"> 7833</span>&#160;    <span class="comment">/* Close date picker if clicked elsewhere. */</span></div>
<div class="line"><a name="l07834"></a><span class="lineno"> 7834</span>&#160;    _checkExternalClick: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l07835"></a><span class="lineno"> 7835</span>&#160;        <span class="keywordflow">if</span> (!$.datepicker._curInst)</div>
<div class="line"><a name="l07836"></a><span class="lineno"> 7836</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07837"></a><span class="lineno"> 7837</span>&#160;</div>
<div class="line"><a name="l07838"></a><span class="lineno"> 7838</span>&#160;        var $target = $(<span class="keyword">event</span>.target),</div>
<div class="line"><a name="l07839"></a><span class="lineno"> 7839</span>&#160;            inst = $.datepicker._getInst($target[0]);</div>
<div class="line"><a name="l07840"></a><span class="lineno"> 7840</span>&#160;</div>
<div class="line"><a name="l07841"></a><span class="lineno"> 7841</span>&#160;        <span class="keywordflow">if</span> ( ( ( $target[0].<span class="keywordtype">id</span> != $.datepicker._mainDivId &amp;&amp;</div>
<div class="line"><a name="l07842"></a><span class="lineno"> 7842</span>&#160;                $target.parents(<span class="charliteral">&#39;#&#39;</span> + $.datepicker._mainDivId).length == 0 &amp;&amp;</div>
<div class="line"><a name="l07843"></a><span class="lineno"> 7843</span>&#160;                !$target.hasClass($.datepicker.markerClassName) &amp;&amp;</div>
<div class="line"><a name="l07844"></a><span class="lineno"> 7844</span>&#160;                !$target.closest(<span class="stringliteral">&quot;.&quot;</span> + $.datepicker._triggerClass).length &amp;&amp;</div>
<div class="line"><a name="l07845"></a><span class="lineno"> 7845</span>&#160;                $.datepicker._datepickerShowing &amp;&amp; !($.datepicker._inDialog &amp;&amp; $.blockUI) ) ) ||</div>
<div class="line"><a name="l07846"></a><span class="lineno"> 7846</span>&#160;            ( $target.hasClass($.datepicker.markerClassName) &amp;&amp; $.datepicker._curInst != inst ) )</div>
<div class="line"><a name="l07847"></a><span class="lineno"> 7847</span>&#160;            $.datepicker._hideDatepicker();</div>
<div class="line"><a name="l07848"></a><span class="lineno"> 7848</span>&#160;    },</div>
<div class="line"><a name="l07849"></a><span class="lineno"> 7849</span>&#160;</div>
<div class="line"><a name="l07850"></a><span class="lineno"> 7850</span>&#160;    <span class="comment">/* Adjust one of the date sub-fields. */</span></div>
<div class="line"><a name="l07851"></a><span class="lineno"> 7851</span>&#160;    _adjustDate: <span class="keyword">function</span>(id, offset, period) {</div>
<div class="line"><a name="l07852"></a><span class="lineno"> 7852</span>&#160;        var target = $(id);</div>
<div class="line"><a name="l07853"></a><span class="lineno"> 7853</span>&#160;        var inst = this._getInst(target[0]);</div>
<div class="line"><a name="l07854"></a><span class="lineno"> 7854</span>&#160;        <span class="keywordflow">if</span> (this._isDisabledDatepicker(target[0])) {</div>
<div class="line"><a name="l07855"></a><span class="lineno"> 7855</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07856"></a><span class="lineno"> 7856</span>&#160;        }</div>
<div class="line"><a name="l07857"></a><span class="lineno"> 7857</span>&#160;        this._adjustInstDate(inst, offset +</div>
<div class="line"><a name="l07858"></a><span class="lineno"> 7858</span>&#160;            (period == <span class="charliteral">&#39;M&#39;</span> ? this._get(inst, <span class="stringliteral">&#39;showCurrentAtPos&#39;</span>) : 0), <span class="comment">// undo positioning</span></div>
<div class="line"><a name="l07859"></a><span class="lineno"> 7859</span>&#160;            period);</div>
<div class="line"><a name="l07860"></a><span class="lineno"> 7860</span>&#160;        this._updateDatepicker(inst);</div>
<div class="line"><a name="l07861"></a><span class="lineno"> 7861</span>&#160;    },</div>
<div class="line"><a name="l07862"></a><span class="lineno"> 7862</span>&#160;</div>
<div class="line"><a name="l07863"></a><span class="lineno"> 7863</span>&#160;    <span class="comment">/* Action for current link. */</span></div>
<div class="line"><a name="l07864"></a><span class="lineno"> 7864</span>&#160;    _gotoToday: <span class="keyword">function</span>(id) {</div>
<div class="line"><a name="l07865"></a><span class="lineno"> 7865</span>&#160;        var target = $(id);</div>
<div class="line"><a name="l07866"></a><span class="lineno"> 7866</span>&#160;        var inst = this._getInst(target[0]);</div>
<div class="line"><a name="l07867"></a><span class="lineno"> 7867</span>&#160;        <span class="keywordflow">if</span> (this._get(inst, <span class="stringliteral">&#39;gotoCurrent&#39;</span>) &amp;&amp; inst.currentDay) {</div>
<div class="line"><a name="l07868"></a><span class="lineno"> 7868</span>&#160;            inst.selectedDay = inst.currentDay;</div>
<div class="line"><a name="l07869"></a><span class="lineno"> 7869</span>&#160;            inst.drawMonth = inst.selectedMonth = inst.currentMonth;</div>
<div class="line"><a name="l07870"></a><span class="lineno"> 7870</span>&#160;            inst.drawYear = inst.selectedYear = inst.currentYear;</div>
<div class="line"><a name="l07871"></a><span class="lineno"> 7871</span>&#160;        }</div>
<div class="line"><a name="l07872"></a><span class="lineno"> 7872</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l07873"></a><span class="lineno"> 7873</span>&#160;            var date = <span class="keyword">new</span> Date();</div>
<div class="line"><a name="l07874"></a><span class="lineno"> 7874</span>&#160;            inst.selectedDay = date.getDate();</div>
<div class="line"><a name="l07875"></a><span class="lineno"> 7875</span>&#160;            inst.drawMonth = inst.selectedMonth = date.getMonth();</div>
<div class="line"><a name="l07876"></a><span class="lineno"> 7876</span>&#160;            inst.drawYear = inst.selectedYear = date.getFullYear();</div>
<div class="line"><a name="l07877"></a><span class="lineno"> 7877</span>&#160;        }</div>
<div class="line"><a name="l07878"></a><span class="lineno"> 7878</span>&#160;        this._notifyChange(inst);</div>
<div class="line"><a name="l07879"></a><span class="lineno"> 7879</span>&#160;        this._adjustDate(target);</div>
<div class="line"><a name="l07880"></a><span class="lineno"> 7880</span>&#160;    },</div>
<div class="line"><a name="l07881"></a><span class="lineno"> 7881</span>&#160;</div>
<div class="line"><a name="l07882"></a><span class="lineno"> 7882</span>&#160;    <span class="comment">/* Action for selecting a new month/year. */</span></div>
<div class="line"><a name="l07883"></a><span class="lineno"> 7883</span>&#160;    _selectMonthYear: <span class="keyword">function</span>(id, select, period) {</div>
<div class="line"><a name="l07884"></a><span class="lineno"> 7884</span>&#160;        var target = $(id);</div>
<div class="line"><a name="l07885"></a><span class="lineno"> 7885</span>&#160;        var inst = this._getInst(target[0]);</div>
<div class="line"><a name="l07886"></a><span class="lineno"> 7886</span>&#160;        inst[<span class="stringliteral">&#39;selected&#39;</span> + (period == <span class="charliteral">&#39;M&#39;</span> ? <span class="stringliteral">&#39;Month&#39;</span> : <span class="stringliteral">&#39;Year&#39;</span>)] =</div>
<div class="line"><a name="l07887"></a><span class="lineno"> 7887</span>&#160;        inst[<span class="stringliteral">&#39;draw&#39;</span> + (period == <span class="charliteral">&#39;M&#39;</span> ? <span class="stringliteral">&#39;Month&#39;</span> : <span class="stringliteral">&#39;Year&#39;</span>)] =</div>
<div class="line"><a name="l07888"></a><span class="lineno"> 7888</span>&#160;            parseInt(select.options[select.selectedIndex].value,10);</div>
<div class="line"><a name="l07889"></a><span class="lineno"> 7889</span>&#160;        this._notifyChange(inst);</div>
<div class="line"><a name="l07890"></a><span class="lineno"> 7890</span>&#160;        this._adjustDate(target);</div>
<div class="line"><a name="l07891"></a><span class="lineno"> 7891</span>&#160;    },</div>
<div class="line"><a name="l07892"></a><span class="lineno"> 7892</span>&#160;</div>
<div class="line"><a name="l07893"></a><span class="lineno"> 7893</span>&#160;    <span class="comment">/* Action for selecting a day. */</span></div>
<div class="line"><a name="l07894"></a><span class="lineno"> 7894</span>&#160;    _selectDay: <span class="keyword">function</span>(id, month, year, td) {</div>
<div class="line"><a name="l07895"></a><span class="lineno"> 7895</span>&#160;        var target = $(id);</div>
<div class="line"><a name="l07896"></a><span class="lineno"> 7896</span>&#160;        <span class="keywordflow">if</span> ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {</div>
<div class="line"><a name="l07897"></a><span class="lineno"> 7897</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l07898"></a><span class="lineno"> 7898</span>&#160;        }</div>
<div class="line"><a name="l07899"></a><span class="lineno"> 7899</span>&#160;        var inst = this._getInst(target[0]);</div>
<div class="line"><a name="l07900"></a><span class="lineno"> 7900</span>&#160;        inst.selectedDay = inst.currentDay = $(<span class="charliteral">&#39;a&#39;</span>, td).html();</div>
<div class="line"><a name="l07901"></a><span class="lineno"> 7901</span>&#160;        inst.selectedMonth = inst.currentMonth = month;</div>
<div class="line"><a name="l07902"></a><span class="lineno"> 7902</span>&#160;        inst.selectedYear = inst.currentYear = year;</div>
<div class="line"><a name="l07903"></a><span class="lineno"> 7903</span>&#160;        this._selectDate(<span class="keywordtype">id</span>, this._formatDate(inst,</div>
<div class="line"><a name="l07904"></a><span class="lineno"> 7904</span>&#160;            inst.currentDay, inst.currentMonth, inst.currentYear));</div>
<div class="line"><a name="l07905"></a><span class="lineno"> 7905</span>&#160;    },</div>
<div class="line"><a name="l07906"></a><span class="lineno"> 7906</span>&#160;</div>
<div class="line"><a name="l07907"></a><span class="lineno"> 7907</span>&#160;    <span class="comment">/* Erase the input field and hide the date picker. */</span></div>
<div class="line"><a name="l07908"></a><span class="lineno"> 7908</span>&#160;    _clearDate: <span class="keyword">function</span>(id) {</div>
<div class="line"><a name="l07909"></a><span class="lineno"> 7909</span>&#160;        var target = $(id);</div>
<div class="line"><a name="l07910"></a><span class="lineno"> 7910</span>&#160;        var inst = this._getInst(target[0]);</div>
<div class="line"><a name="l07911"></a><span class="lineno"> 7911</span>&#160;        this._selectDate(target, <span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l07912"></a><span class="lineno"> 7912</span>&#160;    },</div>
<div class="line"><a name="l07913"></a><span class="lineno"> 7913</span>&#160;</div>
<div class="line"><a name="l07914"></a><span class="lineno"> 7914</span>&#160;    <span class="comment">/* Update the input field with the selected date. */</span></div>
<div class="line"><a name="l07915"></a><span class="lineno"> 7915</span>&#160;    _selectDate: <span class="keyword">function</span>(id, dateStr) {</div>
<div class="line"><a name="l07916"></a><span class="lineno"> 7916</span>&#160;        var target = $(id);</div>
<div class="line"><a name="l07917"></a><span class="lineno"> 7917</span>&#160;        var inst = this._getInst(target[0]);</div>
<div class="line"><a name="l07918"></a><span class="lineno"> 7918</span>&#160;        dateStr = (dateStr != null ? dateStr : this._formatDate(inst));</div>
<div class="line"><a name="l07919"></a><span class="lineno"> 7919</span>&#160;        <span class="keywordflow">if</span> (inst.input)</div>
<div class="line"><a name="l07920"></a><span class="lineno"> 7920</span>&#160;            inst.input.val(dateStr);</div>
<div class="line"><a name="l07921"></a><span class="lineno"> 7921</span>&#160;        this._updateAlternate(inst);</div>
<div class="line"><a name="l07922"></a><span class="lineno"> 7922</span>&#160;        var onSelect = this._get(inst, <span class="stringliteral">&#39;onSelect&#39;</span>);</div>
<div class="line"><a name="l07923"></a><span class="lineno"> 7923</span>&#160;        <span class="keywordflow">if</span> (onSelect)</div>
<div class="line"><a name="l07924"></a><span class="lineno"> 7924</span>&#160;            onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  <span class="comment">// trigger custom callback</span></div>
<div class="line"><a name="l07925"></a><span class="lineno"> 7925</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (inst.input)</div>
<div class="line"><a name="l07926"></a><span class="lineno"> 7926</span>&#160;            inst.input.trigger(<span class="stringliteral">&#39;change&#39;</span>); <span class="comment">// fire the change event</span></div>
<div class="line"><a name="l07927"></a><span class="lineno"> 7927</span>&#160;        <span class="keywordflow">if</span> (inst.inline)</div>
<div class="line"><a name="l07928"></a><span class="lineno"> 7928</span>&#160;            this._updateDatepicker(inst);</div>
<div class="line"><a name="l07929"></a><span class="lineno"> 7929</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l07930"></a><span class="lineno"> 7930</span>&#160;            this._hideDatepicker();</div>
<div class="line"><a name="l07931"></a><span class="lineno"> 7931</span>&#160;            this._lastInput = inst.input[0];</div>
<div class="line"><a name="l07932"></a><span class="lineno"> 7932</span>&#160;            <span class="keywordflow">if</span> (typeof(inst.input[0]) != <span class="stringliteral">&#39;object&#39;</span>)</div>
<div class="line"><a name="l07933"></a><span class="lineno"> 7933</span>&#160;                inst.input.focus(); <span class="comment">// restore focus</span></div>
<div class="line"><a name="l07934"></a><span class="lineno"> 7934</span>&#160;            this._lastInput = null;</div>
<div class="line"><a name="l07935"></a><span class="lineno"> 7935</span>&#160;        }</div>
<div class="line"><a name="l07936"></a><span class="lineno"> 7936</span>&#160;    },</div>
<div class="line"><a name="l07937"></a><span class="lineno"> 7937</span>&#160;</div>
<div class="line"><a name="l07938"></a><span class="lineno"> 7938</span>&#160;    <span class="comment">/* Update any alternate field to synchronise with the main field. */</span></div>
<div class="line"><a name="l07939"></a><span class="lineno"> 7939</span>&#160;    _updateAlternate: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l07940"></a><span class="lineno"> 7940</span>&#160;        var altField = this._get(inst, <span class="stringliteral">&#39;altField&#39;</span>);</div>
<div class="line"><a name="l07941"></a><span class="lineno"> 7941</span>&#160;        <span class="keywordflow">if</span> (altField) { <span class="comment">// update alternate field too</span></div>
<div class="line"><a name="l07942"></a><span class="lineno"> 7942</span>&#160;            var altFormat = this._get(inst, <span class="stringliteral">&#39;altFormat&#39;</span>) || this._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>);</div>
<div class="line"><a name="l07943"></a><span class="lineno"> 7943</span>&#160;            var date = this._getDate(inst);</div>
<div class="line"><a name="l07944"></a><span class="lineno"> 7944</span>&#160;            var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));</div>
<div class="line"><a name="l07945"></a><span class="lineno"> 7945</span>&#160;            $(altField).each(<span class="keyword">function</span>() { $(<span class="keyword">this</span>).val(dateStr); });</div>
<div class="line"><a name="l07946"></a><span class="lineno"> 7946</span>&#160;        }</div>
<div class="line"><a name="l07947"></a><span class="lineno"> 7947</span>&#160;    },</div>
<div class="line"><a name="l07948"></a><span class="lineno"> 7948</span>&#160;</div>
<div class="line"><a name="l07949"></a><span class="lineno"> 7949</span>&#160;    <span class="comment">/* Set as beforeShowDay function to prevent selection of weekends.</span></div>
<div class="line"><a name="l07950"></a><span class="lineno"> 7950</span>&#160;<span class="comment">       @param  date  Date - the date to customise</span></div>
<div class="line"><a name="l07951"></a><span class="lineno"> 7951</span>&#160;<span class="comment">       @return [boolean, string] - is this date selectable?, what is its CSS class? */</span></div>
<div class="line"><a name="l07952"></a><span class="lineno"> 7952</span>&#160;    noWeekends: <span class="keyword">function</span>(date) {</div>
<div class="line"><a name="l07953"></a><span class="lineno"> 7953</span>&#160;        var day = date.getDay();</div>
<div class="line"><a name="l07954"></a><span class="lineno"> 7954</span>&#160;        <span class="keywordflow">return</span> [(day &gt; 0 &amp;&amp; day &lt; 6), <span class="stringliteral">&#39;&#39;</span>];</div>
<div class="line"><a name="l07955"></a><span class="lineno"> 7955</span>&#160;    },</div>
<div class="line"><a name="l07956"></a><span class="lineno"> 7956</span>&#160;</div>
<div class="line"><a name="l07957"></a><span class="lineno"> 7957</span>&#160;    <span class="comment">/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.</span></div>
<div class="line"><a name="l07958"></a><span class="lineno"> 7958</span>&#160;<span class="comment">       @param  date  Date - the date to get the week for</span></div>
<div class="line"><a name="l07959"></a><span class="lineno"> 7959</span>&#160;<span class="comment">       @return  number - the number of the week within the year that contains this date */</span></div>
<div class="line"><a name="l07960"></a><span class="lineno"> 7960</span>&#160;    iso8601Week: <span class="keyword">function</span>(date) {</div>
<div class="line"><a name="l07961"></a><span class="lineno"> 7961</span>&#160;        var checkDate = <span class="keyword">new</span> Date(date.getTime());</div>
<div class="line"><a name="l07962"></a><span class="lineno"> 7962</span>&#160;        <span class="comment">// Find Thursday of this week starting on Monday</span></div>
<div class="line"><a name="l07963"></a><span class="lineno"> 7963</span>&#160;        checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));</div>
<div class="line"><a name="l07964"></a><span class="lineno"> 7964</span>&#160;        var time = checkDate.getTime();</div>
<div class="line"><a name="l07965"></a><span class="lineno"> 7965</span>&#160;        checkDate.setMonth(0); <span class="comment">// Compare with Jan 1</span></div>
<div class="line"><a name="l07966"></a><span class="lineno"> 7966</span>&#160;        checkDate.setDate(1);</div>
<div class="line"><a name="l07967"></a><span class="lineno"> 7967</span>&#160;        <span class="keywordflow">return</span> Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;</div>
<div class="line"><a name="l07968"></a><span class="lineno"> 7968</span>&#160;    },</div>
<div class="line"><a name="l07969"></a><span class="lineno"> 7969</span>&#160;</div>
<div class="line"><a name="l07970"></a><span class="lineno"> 7970</span>&#160;    <span class="comment">/* Parse a string value into a date object.</span></div>
<div class="line"><a name="l07971"></a><span class="lineno"> 7971</span>&#160;<span class="comment">       See formatDate below for the possible formats.</span></div>
<div class="line"><a name="l07972"></a><span class="lineno"> 7972</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l07973"></a><span class="lineno"> 7973</span>&#160;<span class="comment">       @param  format    string - the expected format of the date</span></div>
<div class="line"><a name="l07974"></a><span class="lineno"> 7974</span>&#160;<span class="comment">       @param  value     string - the date in the above format</span></div>
<div class="line"><a name="l07975"></a><span class="lineno"> 7975</span>&#160;<span class="comment">       @param  settings  Object - attributes include:</span></div>
<div class="line"><a name="l07976"></a><span class="lineno"> 7976</span>&#160;<span class="comment">                         shortYearCutoff  number - the cutoff year for determining the century (optional)</span></div>
<div class="line"><a name="l07977"></a><span class="lineno"> 7977</span>&#160;<span class="comment">                         dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)</span></div>
<div class="line"><a name="l07978"></a><span class="lineno"> 7978</span>&#160;<span class="comment">                         dayNames         string[7] - names of the days from Sunday (optional)</span></div>
<div class="line"><a name="l07979"></a><span class="lineno"> 7979</span>&#160;<span class="comment">                         monthNamesShort  string[12] - abbreviated names of the months (optional)</span></div>
<div class="line"><a name="l07980"></a><span class="lineno"> 7980</span>&#160;<span class="comment">                         monthNames       string[12] - names of the months (optional)</span></div>
<div class="line"><a name="l07981"></a><span class="lineno"> 7981</span>&#160;<span class="comment">       @return  Date - the extracted date value or null if value is blank */</span></div>
<div class="line"><a name="l07982"></a><span class="lineno"> 7982</span>&#160;    parseDate: <span class="keyword">function</span> (format, value, settings) {</div>
<div class="line"><a name="l07983"></a><span class="lineno"> 7983</span>&#160;        <span class="keywordflow">if</span> (format == null || value == null)</div>
<div class="line"><a name="l07984"></a><span class="lineno"> 7984</span>&#160;            <span class="keywordflow">throw</span> <span class="stringliteral">&#39;Invalid arguments&#39;</span>;</div>
<div class="line"><a name="l07985"></a><span class="lineno"> 7985</span>&#160;        value = (typeof value == <span class="stringliteral">&#39;object&#39;</span> ? value.toString() : value + <span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l07986"></a><span class="lineno"> 7986</span>&#160;        <span class="keywordflow">if</span> (value == <span class="stringliteral">&#39;&#39;</span>)</div>
<div class="line"><a name="l07987"></a><span class="lineno"> 7987</span>&#160;            <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l07988"></a><span class="lineno"> 7988</span>&#160;        var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;</div>
<div class="line"><a name="l07989"></a><span class="lineno"> 7989</span>&#160;        shortYearCutoff = (typeof shortYearCutoff != <span class="stringliteral">&#39;string&#39;</span> ? shortYearCutoff :</div>
<div class="line"><a name="l07990"></a><span class="lineno"> 7990</span>&#160;                <span class="keyword">new</span> Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));</div>
<div class="line"><a name="l07991"></a><span class="lineno"> 7991</span>&#160;        var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;</div>
<div class="line"><a name="l07992"></a><span class="lineno"> 7992</span>&#160;        var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;</div>
<div class="line"><a name="l07993"></a><span class="lineno"> 7993</span>&#160;        var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;</div>
<div class="line"><a name="l07994"></a><span class="lineno"> 7994</span>&#160;        var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;</div>
<div class="line"><a name="l07995"></a><span class="lineno"> 7995</span>&#160;        var year = -1;</div>
<div class="line"><a name="l07996"></a><span class="lineno"> 7996</span>&#160;        var month = -1;</div>
<div class="line"><a name="l07997"></a><span class="lineno"> 7997</span>&#160;        var day = -1;</div>
<div class="line"><a name="l07998"></a><span class="lineno"> 7998</span>&#160;        var doy = -1;</div>
<div class="line"><a name="l07999"></a><span class="lineno"> 7999</span>&#160;        var literal = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08000"></a><span class="lineno"> 8000</span>&#160;        <span class="comment">// Check whether a format character is doubled</span></div>
<div class="line"><a name="l08001"></a><span class="lineno"> 8001</span>&#160;        var lookAhead = <span class="keyword">function</span>(match) {</div>
<div class="line"><a name="l08002"></a><span class="lineno"> 8002</span>&#160;            var matches = (iFormat + 1 &lt; format.length &amp;&amp; format.charAt(iFormat + 1) == match);</div>
<div class="line"><a name="l08003"></a><span class="lineno"> 8003</span>&#160;            <span class="keywordflow">if</span> (matches)</div>
<div class="line"><a name="l08004"></a><span class="lineno"> 8004</span>&#160;                iFormat++;</div>
<div class="line"><a name="l08005"></a><span class="lineno"> 8005</span>&#160;            <span class="keywordflow">return</span> matches;</div>
<div class="line"><a name="l08006"></a><span class="lineno"> 8006</span>&#160;        };</div>
<div class="line"><a name="l08007"></a><span class="lineno"> 8007</span>&#160;        <span class="comment">// Extract a number from the string value</span></div>
<div class="line"><a name="l08008"></a><span class="lineno"> 8008</span>&#160;        var getNumber = <span class="keyword">function</span>(match) {</div>
<div class="line"><a name="l08009"></a><span class="lineno"> 8009</span>&#160;            var isDoubled = lookAhead(match);</div>
<div class="line"><a name="l08010"></a><span class="lineno"> 8010</span>&#160;            var size = (match == <span class="charliteral">&#39;@&#39;</span> ? 14 : (match == <span class="charliteral">&#39;!&#39;</span> ? 20 :</div>
<div class="line"><a name="l08011"></a><span class="lineno"> 8011</span>&#160;                (match == <span class="charliteral">&#39;y&#39;</span> &amp;&amp; isDoubled ? 4 : (match == <span class="charliteral">&#39;o&#39;</span> ? 3 : 2))));</div>
<div class="line"><a name="l08012"></a><span class="lineno"> 8012</span>&#160;            var digits = <span class="keyword">new</span> RegExp(<span class="stringliteral">&#39;^\\d{1,&#39;</span> + size + <span class="charliteral">&#39;}&#39;</span>);</div>
<div class="line"><a name="l08013"></a><span class="lineno"> 8013</span>&#160;            var num = value.substring(iValue).match(digits);</div>
<div class="line"><a name="l08014"></a><span class="lineno"> 8014</span>&#160;            <span class="keywordflow">if</span> (!num)</div>
<div class="line"><a name="l08015"></a><span class="lineno"> 8015</span>&#160;                <span class="keywordflow">throw</span> <span class="stringliteral">&#39;Missing number at position &#39;</span> + iValue;</div>
<div class="line"><a name="l08016"></a><span class="lineno"> 8016</span>&#160;            iValue += num[0].length;</div>
<div class="line"><a name="l08017"></a><span class="lineno"> 8017</span>&#160;            <span class="keywordflow">return</span> parseInt(num[0], 10);</div>
<div class="line"><a name="l08018"></a><span class="lineno"> 8018</span>&#160;        };</div>
<div class="line"><a name="l08019"></a><span class="lineno"> 8019</span>&#160;        <span class="comment">// Extract a name from the string value and convert to an index</span></div>
<div class="line"><a name="l08020"></a><span class="lineno"> 8020</span>&#160;        var getName = <span class="keyword">function</span>(match, shortNames, longNames) {</div>
<div class="line"><a name="l08021"></a><span class="lineno"> 8021</span>&#160;            var names = $.map(lookAhead(match) ? longNames : shortNames, <span class="keyword">function</span> (v, k) {</div>
<div class="line"><a name="l08022"></a><span class="lineno"> 8022</span>&#160;                <span class="keywordflow">return</span> [ [k, v] ];</div>
<div class="line"><a name="l08023"></a><span class="lineno"> 8023</span>&#160;            }).sort(<span class="keyword">function</span> (a, b) {</div>
<div class="line"><a name="l08024"></a><span class="lineno"> 8024</span>&#160;                <span class="keywordflow">return</span> -(a[1].length - b[1].length);</div>
<div class="line"><a name="l08025"></a><span class="lineno"> 8025</span>&#160;            });</div>
<div class="line"><a name="l08026"></a><span class="lineno"> 8026</span>&#160;            var index = -1;</div>
<div class="line"><a name="l08027"></a><span class="lineno"> 8027</span>&#160;            $.each(names, <span class="keyword">function</span> (i, pair) {</div>
<div class="line"><a name="l08028"></a><span class="lineno"> 8028</span>&#160;                var name = pair[1];</div>
<div class="line"><a name="l08029"></a><span class="lineno"> 8029</span>&#160;                <span class="keywordflow">if</span> (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {</div>
<div class="line"><a name="l08030"></a><span class="lineno"> 8030</span>&#160;                    index = pair[0];</div>
<div class="line"><a name="l08031"></a><span class="lineno"> 8031</span>&#160;                    iValue += name.length;</div>
<div class="line"><a name="l08032"></a><span class="lineno"> 8032</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l08033"></a><span class="lineno"> 8033</span>&#160;                }</div>
<div class="line"><a name="l08034"></a><span class="lineno"> 8034</span>&#160;            });</div>
<div class="line"><a name="l08035"></a><span class="lineno"> 8035</span>&#160;            <span class="keywordflow">if</span> (index != -1)</div>
<div class="line"><a name="l08036"></a><span class="lineno"> 8036</span>&#160;                <span class="keywordflow">return</span> index + 1;</div>
<div class="line"><a name="l08037"></a><span class="lineno"> 8037</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l08038"></a><span class="lineno"> 8038</span>&#160;                <span class="keywordflow">throw</span> <span class="stringliteral">&#39;Unknown name at position &#39;</span> + iValue;</div>
<div class="line"><a name="l08039"></a><span class="lineno"> 8039</span>&#160;        };</div>
<div class="line"><a name="l08040"></a><span class="lineno"> 8040</span>&#160;        <span class="comment">// Confirm that a literal character matches the string value</span></div>
<div class="line"><a name="l08041"></a><span class="lineno"> 8041</span>&#160;        var checkLiteral = <span class="keyword">function</span>() {</div>
<div class="line"><a name="l08042"></a><span class="lineno"> 8042</span>&#160;            <span class="keywordflow">if</span> (value.charAt(iValue) != format.charAt(iFormat))</div>
<div class="line"><a name="l08043"></a><span class="lineno"> 8043</span>&#160;                <span class="keywordflow">throw</span> <span class="stringliteral">&#39;Unexpected literal at position &#39;</span> + iValue;</div>
<div class="line"><a name="l08044"></a><span class="lineno"> 8044</span>&#160;            iValue++;</div>
<div class="line"><a name="l08045"></a><span class="lineno"> 8045</span>&#160;        };</div>
<div class="line"><a name="l08046"></a><span class="lineno"> 8046</span>&#160;        var iValue = 0;</div>
<div class="line"><a name="l08047"></a><span class="lineno"> 8047</span>&#160;        <span class="keywordflow">for</span> (var iFormat = 0; iFormat &lt; format.length; iFormat++) {</div>
<div class="line"><a name="l08048"></a><span class="lineno"> 8048</span>&#160;            <span class="keywordflow">if</span> (literal)</div>
<div class="line"><a name="l08049"></a><span class="lineno"> 8049</span>&#160;                <span class="keywordflow">if</span> (format.charAt(iFormat) == <span class="stringliteral">&quot;&#39;&quot;</span> &amp;&amp; !lookAhead(<span class="stringliteral">&quot;&#39;&quot;</span>))</div>
<div class="line"><a name="l08050"></a><span class="lineno"> 8050</span>&#160;                    literal = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08051"></a><span class="lineno"> 8051</span>&#160;                <span class="keywordflow">else</span></div>
<div class="line"><a name="l08052"></a><span class="lineno"> 8052</span>&#160;                    checkLiteral();</div>
<div class="line"><a name="l08053"></a><span class="lineno"> 8053</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l08054"></a><span class="lineno"> 8054</span>&#160;                <span class="keywordflow">switch</span> (format.charAt(iFormat)) {</div>
<div class="line"><a name="l08055"></a><span class="lineno"> 8055</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;d&#39;</span>:</div>
<div class="line"><a name="l08056"></a><span class="lineno"> 8056</span>&#160;                        day = getNumber(<span class="charliteral">&#39;d&#39;</span>);</div>
<div class="line"><a name="l08057"></a><span class="lineno"> 8057</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08058"></a><span class="lineno"> 8058</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;D&#39;</span>:</div>
<div class="line"><a name="l08059"></a><span class="lineno"> 8059</span>&#160;                        getName(<span class="charliteral">&#39;D&#39;</span>, dayNamesShort, dayNames);</div>
<div class="line"><a name="l08060"></a><span class="lineno"> 8060</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08061"></a><span class="lineno"> 8061</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;o&#39;</span>:</div>
<div class="line"><a name="l08062"></a><span class="lineno"> 8062</span>&#160;                        doy = getNumber(<span class="charliteral">&#39;o&#39;</span>);</div>
<div class="line"><a name="l08063"></a><span class="lineno"> 8063</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08064"></a><span class="lineno"> 8064</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;m&#39;</span>:</div>
<div class="line"><a name="l08065"></a><span class="lineno"> 8065</span>&#160;                        month = getNumber(<span class="charliteral">&#39;m&#39;</span>);</div>
<div class="line"><a name="l08066"></a><span class="lineno"> 8066</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08067"></a><span class="lineno"> 8067</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;M&#39;</span>:</div>
<div class="line"><a name="l08068"></a><span class="lineno"> 8068</span>&#160;                        month = getName(<span class="charliteral">&#39;M&#39;</span>, monthNamesShort, monthNames);</div>
<div class="line"><a name="l08069"></a><span class="lineno"> 8069</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08070"></a><span class="lineno"> 8070</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;y&#39;</span>:</div>
<div class="line"><a name="l08071"></a><span class="lineno"> 8071</span>&#160;                        year = getNumber(<span class="charliteral">&#39;y&#39;</span>);</div>
<div class="line"><a name="l08072"></a><span class="lineno"> 8072</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08073"></a><span class="lineno"> 8073</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;@&#39;</span>:</div>
<div class="line"><a name="l08074"></a><span class="lineno"> 8074</span>&#160;                        var date = <span class="keyword">new</span> Date(getNumber(<span class="charliteral">&#39;@&#39;</span>));</div>
<div class="line"><a name="l08075"></a><span class="lineno"> 8075</span>&#160;                        year = date.getFullYear();</div>
<div class="line"><a name="l08076"></a><span class="lineno"> 8076</span>&#160;                        month = date.getMonth() + 1;</div>
<div class="line"><a name="l08077"></a><span class="lineno"> 8077</span>&#160;                        day = date.getDate();</div>
<div class="line"><a name="l08078"></a><span class="lineno"> 8078</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08079"></a><span class="lineno"> 8079</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;!&#39;</span>:</div>
<div class="line"><a name="l08080"></a><span class="lineno"> 8080</span>&#160;                        var date = <span class="keyword">new</span> Date((getNumber(<span class="charliteral">&#39;!&#39;</span>) - this._ticksTo1970) / 10000);</div>
<div class="line"><a name="l08081"></a><span class="lineno"> 8081</span>&#160;                        year = date.getFullYear();</div>
<div class="line"><a name="l08082"></a><span class="lineno"> 8082</span>&#160;                        month = date.getMonth() + 1;</div>
<div class="line"><a name="l08083"></a><span class="lineno"> 8083</span>&#160;                        day = date.getDate();</div>
<div class="line"><a name="l08084"></a><span class="lineno"> 8084</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08085"></a><span class="lineno"> 8085</span>&#160;                    <span class="keywordflow">case</span> <span class="stringliteral">&quot;&#39;&quot;</span>:</div>
<div class="line"><a name="l08086"></a><span class="lineno"> 8086</span>&#160;                        <span class="keywordflow">if</span> (lookAhead(<span class="stringliteral">&quot;&#39;&quot;</span>))</div>
<div class="line"><a name="l08087"></a><span class="lineno"> 8087</span>&#160;                            checkLiteral();</div>
<div class="line"><a name="l08088"></a><span class="lineno"> 8088</span>&#160;                        <span class="keywordflow">else</span></div>
<div class="line"><a name="l08089"></a><span class="lineno"> 8089</span>&#160;                            literal = <span class="keyword">true</span>;</div>
<div class="line"><a name="l08090"></a><span class="lineno"> 8090</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08091"></a><span class="lineno"> 8091</span>&#160;                    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l08092"></a><span class="lineno"> 8092</span>&#160;                        checkLiteral();</div>
<div class="line"><a name="l08093"></a><span class="lineno"> 8093</span>&#160;                }</div>
<div class="line"><a name="l08094"></a><span class="lineno"> 8094</span>&#160;        }</div>
<div class="line"><a name="l08095"></a><span class="lineno"> 8095</span>&#160;        <span class="keywordflow">if</span> (iValue &lt; value.length){</div>
<div class="line"><a name="l08096"></a><span class="lineno"> 8096</span>&#160;            <span class="keywordflow">throw</span> <span class="stringliteral">&quot;Extra/unparsed characters found in date: &quot;</span> + value.substring(iValue);</div>
<div class="line"><a name="l08097"></a><span class="lineno"> 8097</span>&#160;        }</div>
<div class="line"><a name="l08098"></a><span class="lineno"> 8098</span>&#160;        <span class="keywordflow">if</span> (year == -1)</div>
<div class="line"><a name="l08099"></a><span class="lineno"> 8099</span>&#160;            year = <span class="keyword">new</span> Date().getFullYear();</div>
<div class="line"><a name="l08100"></a><span class="lineno"> 8100</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (year &lt; 100)</div>
<div class="line"><a name="l08101"></a><span class="lineno"> 8101</span>&#160;            year += <span class="keyword">new</span> Date().getFullYear() - <span class="keyword">new</span> Date().getFullYear() % 100 +</div>
<div class="line"><a name="l08102"></a><span class="lineno"> 8102</span>&#160;                (year &lt;= shortYearCutoff ? 0 : -100);</div>
<div class="line"><a name="l08103"></a><span class="lineno"> 8103</span>&#160;        <span class="keywordflow">if</span> (doy &gt; -1) {</div>
<div class="line"><a name="l08104"></a><span class="lineno"> 8104</span>&#160;            month = 1;</div>
<div class="line"><a name="l08105"></a><span class="lineno"> 8105</span>&#160;            day = doy;</div>
<div class="line"><a name="l08106"></a><span class="lineno"> 8106</span>&#160;            <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l08107"></a><span class="lineno"> 8107</span>&#160;                var dim = this._getDaysInMonth(year, month - 1);</div>
<div class="line"><a name="l08108"></a><span class="lineno"> 8108</span>&#160;                <span class="keywordflow">if</span> (day &lt;= dim)</div>
<div class="line"><a name="l08109"></a><span class="lineno"> 8109</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08110"></a><span class="lineno"> 8110</span>&#160;                month++;</div>
<div class="line"><a name="l08111"></a><span class="lineno"> 8111</span>&#160;                day -= dim;</div>
<div class="line"><a name="l08112"></a><span class="lineno"> 8112</span>&#160;            } <span class="keywordflow">while</span> (<span class="keyword">true</span>);</div>
<div class="line"><a name="l08113"></a><span class="lineno"> 8113</span>&#160;        }</div>
<div class="line"><a name="l08114"></a><span class="lineno"> 8114</span>&#160;        var date = this._daylightSavingAdjust(<span class="keyword">new</span> Date(year, month - 1, day));</div>
<div class="line"><a name="l08115"></a><span class="lineno"> 8115</span>&#160;        <span class="keywordflow">if</span> (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)</div>
<div class="line"><a name="l08116"></a><span class="lineno"> 8116</span>&#160;            <span class="keywordflow">throw</span> <span class="stringliteral">&#39;Invalid date&#39;</span>; <span class="comment">// E.g. 31/02/00</span></div>
<div class="line"><a name="l08117"></a><span class="lineno"> 8117</span>&#160;        <span class="keywordflow">return</span> date;</div>
<div class="line"><a name="l08118"></a><span class="lineno"> 8118</span>&#160;    },</div>
<div class="line"><a name="l08119"></a><span class="lineno"> 8119</span>&#160;</div>
<div class="line"><a name="l08120"></a><span class="lineno"> 8120</span>&#160;    <span class="comment">/* Standard date formats. */</span></div>
<div class="line"><a name="l08121"></a><span class="lineno"> 8121</span>&#160;    ATOM: <span class="stringliteral">&#39;yy-mm-dd&#39;</span>, <span class="comment">// RFC 3339 (ISO 8601)</span></div>
<div class="line"><a name="l08122"></a><span class="lineno"> 8122</span>&#160;    COOKIE: <span class="stringliteral">&#39;D, dd M yy&#39;</span>,</div>
<div class="line"><a name="l08123"></a><span class="lineno"> 8123</span>&#160;    ISO_8601: <span class="stringliteral">&#39;yy-mm-dd&#39;</span>,</div>
<div class="line"><a name="l08124"></a><span class="lineno"> 8124</span>&#160;    RFC_822: <span class="stringliteral">&#39;D, d M y&#39;</span>,</div>
<div class="line"><a name="l08125"></a><span class="lineno"> 8125</span>&#160;    RFC_850: <span class="stringliteral">&#39;DD, dd-M-y&#39;</span>,</div>
<div class="line"><a name="l08126"></a><span class="lineno"> 8126</span>&#160;    RFC_1036: <span class="stringliteral">&#39;D, d M y&#39;</span>,</div>
<div class="line"><a name="l08127"></a><span class="lineno"> 8127</span>&#160;    RFC_1123: <span class="stringliteral">&#39;D, d M yy&#39;</span>,</div>
<div class="line"><a name="l08128"></a><span class="lineno"> 8128</span>&#160;    RFC_2822: <span class="stringliteral">&#39;D, d M yy&#39;</span>,</div>
<div class="line"><a name="l08129"></a><span class="lineno"> 8129</span>&#160;    RSS: <span class="stringliteral">&#39;D, d M y&#39;</span>, <span class="comment">// RFC 822</span></div>
<div class="line"><a name="l08130"></a><span class="lineno"> 8130</span>&#160;    TICKS: <span class="charliteral">&#39;!&#39;</span>,</div>
<div class="line"><a name="l08131"></a><span class="lineno"> 8131</span>&#160;    TIMESTAMP: <span class="charliteral">&#39;@&#39;</span>,</div>
<div class="line"><a name="l08132"></a><span class="lineno"> 8132</span>&#160;    W3C: <span class="stringliteral">&#39;yy-mm-dd&#39;</span>, <span class="comment">// ISO 8601</span></div>
<div class="line"><a name="l08133"></a><span class="lineno"> 8133</span>&#160;</div>
<div class="line"><a name="l08134"></a><span class="lineno"> 8134</span>&#160;    _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +</div>
<div class="line"><a name="l08135"></a><span class="lineno"> 8135</span>&#160;        Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),</div>
<div class="line"><a name="l08136"></a><span class="lineno"> 8136</span>&#160;</div>
<div class="line"><a name="l08137"></a><span class="lineno"> 8137</span>&#160;    <span class="comment">/* Format a date object into a string value.</span></div>
<div class="line"><a name="l08138"></a><span class="lineno"> 8138</span>&#160;<span class="comment">       The format can be combinations of the following:</span></div>
<div class="line"><a name="l08139"></a><span class="lineno"> 8139</span>&#160;<span class="comment">       d  - day of month (no leading zero)</span></div>
<div class="line"><a name="l08140"></a><span class="lineno"> 8140</span>&#160;<span class="comment">       dd - day of month (two digit)</span></div>
<div class="line"><a name="l08141"></a><span class="lineno"> 8141</span>&#160;<span class="comment">       o  - day of year (no leading zeros)</span></div>
<div class="line"><a name="l08142"></a><span class="lineno"> 8142</span>&#160;<span class="comment">       oo - day of year (three digit)</span></div>
<div class="line"><a name="l08143"></a><span class="lineno"> 8143</span>&#160;<span class="comment">       D  - day name short</span></div>
<div class="line"><a name="l08144"></a><span class="lineno"> 8144</span>&#160;<span class="comment">       DD - day name long</span></div>
<div class="line"><a name="l08145"></a><span class="lineno"> 8145</span>&#160;<span class="comment">       m  - month of year (no leading zero)</span></div>
<div class="line"><a name="l08146"></a><span class="lineno"> 8146</span>&#160;<span class="comment">       mm - month of year (two digit)</span></div>
<div class="line"><a name="l08147"></a><span class="lineno"> 8147</span>&#160;<span class="comment">       M  - month name short</span></div>
<div class="line"><a name="l08148"></a><span class="lineno"> 8148</span>&#160;<span class="comment">       MM - month name long</span></div>
<div class="line"><a name="l08149"></a><span class="lineno"> 8149</span>&#160;<span class="comment">       y  - year (two digit)</span></div>
<div class="line"><a name="l08150"></a><span class="lineno"> 8150</span>&#160;<span class="comment">       yy - year (four digit)</span></div>
<div class="line"><a name="l08151"></a><span class="lineno"> 8151</span>&#160;<span class="comment">       @ - Unix timestamp (ms since 01/01/1970)</span></div>
<div class="line"><a name="l08152"></a><span class="lineno"> 8152</span>&#160;<span class="comment">       ! - Windows ticks (100ns since 01/01/0001)</span></div>
<div class="line"><a name="l08153"></a><span class="lineno"> 8153</span>&#160;<span class="comment">       &#39;...&#39; - literal text</span></div>
<div class="line"><a name="l08154"></a><span class="lineno"> 8154</span>&#160;<span class="comment">       &#39;&#39; - single quote</span></div>
<div class="line"><a name="l08155"></a><span class="lineno"> 8155</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l08156"></a><span class="lineno"> 8156</span>&#160;<span class="comment">       @param  format    string - the desired format of the date</span></div>
<div class="line"><a name="l08157"></a><span class="lineno"> 8157</span>&#160;<span class="comment">       @param  date      Date - the date value to format</span></div>
<div class="line"><a name="l08158"></a><span class="lineno"> 8158</span>&#160;<span class="comment">       @param  settings  Object - attributes include:</span></div>
<div class="line"><a name="l08159"></a><span class="lineno"> 8159</span>&#160;<span class="comment">                         dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)</span></div>
<div class="line"><a name="l08160"></a><span class="lineno"> 8160</span>&#160;<span class="comment">                         dayNames         string[7] - names of the days from Sunday (optional)</span></div>
<div class="line"><a name="l08161"></a><span class="lineno"> 8161</span>&#160;<span class="comment">                         monthNamesShort  string[12] - abbreviated names of the months (optional)</span></div>
<div class="line"><a name="l08162"></a><span class="lineno"> 8162</span>&#160;<span class="comment">                         monthNames       string[12] - names of the months (optional)</span></div>
<div class="line"><a name="l08163"></a><span class="lineno"> 8163</span>&#160;<span class="comment">       @return  string - the date in the above format */</span></div>
<div class="line"><a name="l08164"></a><span class="lineno"> 8164</span>&#160;    formatDate: <span class="keyword">function</span> (format, date, settings) {</div>
<div class="line"><a name="l08165"></a><span class="lineno"> 8165</span>&#160;        <span class="keywordflow">if</span> (!date)</div>
<div class="line"><a name="l08166"></a><span class="lineno"> 8166</span>&#160;            <span class="keywordflow">return</span> <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l08167"></a><span class="lineno"> 8167</span>&#160;        var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;</div>
<div class="line"><a name="l08168"></a><span class="lineno"> 8168</span>&#160;        var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;</div>
<div class="line"><a name="l08169"></a><span class="lineno"> 8169</span>&#160;        var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;</div>
<div class="line"><a name="l08170"></a><span class="lineno"> 8170</span>&#160;        var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;</div>
<div class="line"><a name="l08171"></a><span class="lineno"> 8171</span>&#160;        <span class="comment">// Check whether a format character is doubled</span></div>
<div class="line"><a name="l08172"></a><span class="lineno"> 8172</span>&#160;        var lookAhead = <span class="keyword">function</span>(match) {</div>
<div class="line"><a name="l08173"></a><span class="lineno"> 8173</span>&#160;            var matches = (iFormat + 1 &lt; format.length &amp;&amp; format.charAt(iFormat + 1) == match);</div>
<div class="line"><a name="l08174"></a><span class="lineno"> 8174</span>&#160;            <span class="keywordflow">if</span> (matches)</div>
<div class="line"><a name="l08175"></a><span class="lineno"> 8175</span>&#160;                iFormat++;</div>
<div class="line"><a name="l08176"></a><span class="lineno"> 8176</span>&#160;            <span class="keywordflow">return</span> matches;</div>
<div class="line"><a name="l08177"></a><span class="lineno"> 8177</span>&#160;        };</div>
<div class="line"><a name="l08178"></a><span class="lineno"> 8178</span>&#160;        <span class="comment">// Format a number, with leading zero if necessary</span></div>
<div class="line"><a name="l08179"></a><span class="lineno"> 8179</span>&#160;        var formatNumber = <span class="keyword">function</span>(match, value, len) {</div>
<div class="line"><a name="l08180"></a><span class="lineno"> 8180</span>&#160;            var num = <span class="stringliteral">&#39;&#39;</span> + value;</div>
<div class="line"><a name="l08181"></a><span class="lineno"> 8181</span>&#160;            <span class="keywordflow">if</span> (lookAhead(match))</div>
<div class="line"><a name="l08182"></a><span class="lineno"> 8182</span>&#160;                <span class="keywordflow">while</span> (num.length &lt; len)</div>
<div class="line"><a name="l08183"></a><span class="lineno"> 8183</span>&#160;                    num = <span class="charliteral">&#39;0&#39;</span> + num;</div>
<div class="line"><a name="l08184"></a><span class="lineno"> 8184</span>&#160;            <span class="keywordflow">return</span> num;</div>
<div class="line"><a name="l08185"></a><span class="lineno"> 8185</span>&#160;        };</div>
<div class="line"><a name="l08186"></a><span class="lineno"> 8186</span>&#160;        <span class="comment">// Format a name, short or long as requested</span></div>
<div class="line"><a name="l08187"></a><span class="lineno"> 8187</span>&#160;        var formatName = <span class="keyword">function</span>(match, value, shortNames, longNames) {</div>
<div class="line"><a name="l08188"></a><span class="lineno"> 8188</span>&#160;            <span class="keywordflow">return</span> (lookAhead(match) ? longNames[value] : shortNames[value]);</div>
<div class="line"><a name="l08189"></a><span class="lineno"> 8189</span>&#160;        };</div>
<div class="line"><a name="l08190"></a><span class="lineno"> 8190</span>&#160;        var output = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l08191"></a><span class="lineno"> 8191</span>&#160;        var literal = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08192"></a><span class="lineno"> 8192</span>&#160;        <span class="keywordflow">if</span> (date)</div>
<div class="line"><a name="l08193"></a><span class="lineno"> 8193</span>&#160;            <span class="keywordflow">for</span> (var iFormat = 0; iFormat &lt; format.length; iFormat++) {</div>
<div class="line"><a name="l08194"></a><span class="lineno"> 8194</span>&#160;                <span class="keywordflow">if</span> (literal)</div>
<div class="line"><a name="l08195"></a><span class="lineno"> 8195</span>&#160;                    <span class="keywordflow">if</span> (format.charAt(iFormat) == <span class="stringliteral">&quot;&#39;&quot;</span> &amp;&amp; !lookAhead(<span class="stringliteral">&quot;&#39;&quot;</span>))</div>
<div class="line"><a name="l08196"></a><span class="lineno"> 8196</span>&#160;                        literal = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08197"></a><span class="lineno"> 8197</span>&#160;                    <span class="keywordflow">else</span></div>
<div class="line"><a name="l08198"></a><span class="lineno"> 8198</span>&#160;                        output += format.charAt(iFormat);</div>
<div class="line"><a name="l08199"></a><span class="lineno"> 8199</span>&#160;                <span class="keywordflow">else</span></div>
<div class="line"><a name="l08200"></a><span class="lineno"> 8200</span>&#160;                    <span class="keywordflow">switch</span> (format.charAt(iFormat)) {</div>
<div class="line"><a name="l08201"></a><span class="lineno"> 8201</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;d&#39;</span>:</div>
<div class="line"><a name="l08202"></a><span class="lineno"> 8202</span>&#160;                            output += formatNumber(<span class="charliteral">&#39;d&#39;</span>, date.getDate(), 2);</div>
<div class="line"><a name="l08203"></a><span class="lineno"> 8203</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08204"></a><span class="lineno"> 8204</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;D&#39;</span>:</div>
<div class="line"><a name="l08205"></a><span class="lineno"> 8205</span>&#160;                            output += formatName(<span class="charliteral">&#39;D&#39;</span>, date.getDay(), dayNamesShort, dayNames);</div>
<div class="line"><a name="l08206"></a><span class="lineno"> 8206</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08207"></a><span class="lineno"> 8207</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;o&#39;</span>:</div>
<div class="line"><a name="l08208"></a><span class="lineno"> 8208</span>&#160;                            output += formatNumber(<span class="charliteral">&#39;o&#39;</span>,</div>
<div class="line"><a name="l08209"></a><span class="lineno"> 8209</span>&#160;                                Math.round((<span class="keyword">new</span> Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - <span class="keyword">new</span> Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);</div>
<div class="line"><a name="l08210"></a><span class="lineno"> 8210</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08211"></a><span class="lineno"> 8211</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;m&#39;</span>:</div>
<div class="line"><a name="l08212"></a><span class="lineno"> 8212</span>&#160;                            output += formatNumber(<span class="charliteral">&#39;m&#39;</span>, date.getMonth() + 1, 2);</div>
<div class="line"><a name="l08213"></a><span class="lineno"> 8213</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08214"></a><span class="lineno"> 8214</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;M&#39;</span>:</div>
<div class="line"><a name="l08215"></a><span class="lineno"> 8215</span>&#160;                            output += formatName(<span class="charliteral">&#39;M&#39;</span>, date.getMonth(), monthNamesShort, monthNames);</div>
<div class="line"><a name="l08216"></a><span class="lineno"> 8216</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08217"></a><span class="lineno"> 8217</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;y&#39;</span>:</div>
<div class="line"><a name="l08218"></a><span class="lineno"> 8218</span>&#160;                            output += (lookAhead(<span class="charliteral">&#39;y&#39;</span>) ? date.getFullYear() :</div>
<div class="line"><a name="l08219"></a><span class="lineno"> 8219</span>&#160;                                (date.getYear() % 100 &lt; 10 ? <span class="charliteral">&#39;0&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) + date.getYear() % 100);</div>
<div class="line"><a name="l08220"></a><span class="lineno"> 8220</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08221"></a><span class="lineno"> 8221</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;@&#39;</span>:</div>
<div class="line"><a name="l08222"></a><span class="lineno"> 8222</span>&#160;                            output += date.getTime();</div>
<div class="line"><a name="l08223"></a><span class="lineno"> 8223</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08224"></a><span class="lineno"> 8224</span>&#160;                        <span class="keywordflow">case</span> <span class="charliteral">&#39;!&#39;</span>:</div>
<div class="line"><a name="l08225"></a><span class="lineno"> 8225</span>&#160;                            output += date.getTime() * 10000 + this._ticksTo1970;</div>
<div class="line"><a name="l08226"></a><span class="lineno"> 8226</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08227"></a><span class="lineno"> 8227</span>&#160;                        <span class="keywordflow">case</span> <span class="stringliteral">&quot;&#39;&quot;</span>:</div>
<div class="line"><a name="l08228"></a><span class="lineno"> 8228</span>&#160;                            <span class="keywordflow">if</span> (lookAhead(<span class="stringliteral">&quot;&#39;&quot;</span>))</div>
<div class="line"><a name="l08229"></a><span class="lineno"> 8229</span>&#160;                                output += <span class="stringliteral">&quot;&#39;&quot;</span>;</div>
<div class="line"><a name="l08230"></a><span class="lineno"> 8230</span>&#160;                            <span class="keywordflow">else</span></div>
<div class="line"><a name="l08231"></a><span class="lineno"> 8231</span>&#160;                                literal = <span class="keyword">true</span>;</div>
<div class="line"><a name="l08232"></a><span class="lineno"> 8232</span>&#160;                            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08233"></a><span class="lineno"> 8233</span>&#160;                        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l08234"></a><span class="lineno"> 8234</span>&#160;                            output += format.charAt(iFormat);</div>
<div class="line"><a name="l08235"></a><span class="lineno"> 8235</span>&#160;                    }</div>
<div class="line"><a name="l08236"></a><span class="lineno"> 8236</span>&#160;            }</div>
<div class="line"><a name="l08237"></a><span class="lineno"> 8237</span>&#160;        <span class="keywordflow">return</span> output;</div>
<div class="line"><a name="l08238"></a><span class="lineno"> 8238</span>&#160;    },</div>
<div class="line"><a name="l08239"></a><span class="lineno"> 8239</span>&#160;</div>
<div class="line"><a name="l08240"></a><span class="lineno"> 8240</span>&#160;    <span class="comment">/* Extract all possible characters from the date format. */</span></div>
<div class="line"><a name="l08241"></a><span class="lineno"> 8241</span>&#160;    _possibleChars: <span class="keyword">function</span> (format) {</div>
<div class="line"><a name="l08242"></a><span class="lineno"> 8242</span>&#160;        var chars = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l08243"></a><span class="lineno"> 8243</span>&#160;        var literal = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08244"></a><span class="lineno"> 8244</span>&#160;        <span class="comment">// Check whether a format character is doubled</span></div>
<div class="line"><a name="l08245"></a><span class="lineno"> 8245</span>&#160;        var lookAhead = <span class="keyword">function</span>(match) {</div>
<div class="line"><a name="l08246"></a><span class="lineno"> 8246</span>&#160;            var matches = (iFormat + 1 &lt; format.length &amp;&amp; format.charAt(iFormat + 1) == match);</div>
<div class="line"><a name="l08247"></a><span class="lineno"> 8247</span>&#160;            <span class="keywordflow">if</span> (matches)</div>
<div class="line"><a name="l08248"></a><span class="lineno"> 8248</span>&#160;                iFormat++;</div>
<div class="line"><a name="l08249"></a><span class="lineno"> 8249</span>&#160;            <span class="keywordflow">return</span> matches;</div>
<div class="line"><a name="l08250"></a><span class="lineno"> 8250</span>&#160;        };</div>
<div class="line"><a name="l08251"></a><span class="lineno"> 8251</span>&#160;        <span class="keywordflow">for</span> (var iFormat = 0; iFormat &lt; format.length; iFormat++)</div>
<div class="line"><a name="l08252"></a><span class="lineno"> 8252</span>&#160;            <span class="keywordflow">if</span> (literal)</div>
<div class="line"><a name="l08253"></a><span class="lineno"> 8253</span>&#160;                <span class="keywordflow">if</span> (format.charAt(iFormat) == <span class="stringliteral">&quot;&#39;&quot;</span> &amp;&amp; !lookAhead(<span class="stringliteral">&quot;&#39;&quot;</span>))</div>
<div class="line"><a name="l08254"></a><span class="lineno"> 8254</span>&#160;                    literal = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08255"></a><span class="lineno"> 8255</span>&#160;                <span class="keywordflow">else</span></div>
<div class="line"><a name="l08256"></a><span class="lineno"> 8256</span>&#160;                    chars += format.charAt(iFormat);</div>
<div class="line"><a name="l08257"></a><span class="lineno"> 8257</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l08258"></a><span class="lineno"> 8258</span>&#160;                <span class="keywordflow">switch</span> (format.charAt(iFormat)) {</div>
<div class="line"><a name="l08259"></a><span class="lineno"> 8259</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;d&#39;</span>: <span class="keywordflow">case</span> <span class="charliteral">&#39;m&#39;</span>: <span class="keywordflow">case</span> <span class="charliteral">&#39;y&#39;</span>: <span class="keywordflow">case</span> <span class="charliteral">&#39;@&#39;</span>:</div>
<div class="line"><a name="l08260"></a><span class="lineno"> 8260</span>&#160;                        chars += <span class="stringliteral">&#39;0123456789&#39;</span>;</div>
<div class="line"><a name="l08261"></a><span class="lineno"> 8261</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08262"></a><span class="lineno"> 8262</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;D&#39;</span>: <span class="keywordflow">case</span> <span class="charliteral">&#39;M&#39;</span>:</div>
<div class="line"><a name="l08263"></a><span class="lineno"> 8263</span>&#160;                        <span class="keywordflow">return</span> null; <span class="comment">// Accept anything</span></div>
<div class="line"><a name="l08264"></a><span class="lineno"> 8264</span>&#160;                    <span class="keywordflow">case</span> <span class="stringliteral">&quot;&#39;&quot;</span>:</div>
<div class="line"><a name="l08265"></a><span class="lineno"> 8265</span>&#160;                        <span class="keywordflow">if</span> (lookAhead(<span class="stringliteral">&quot;&#39;&quot;</span>))</div>
<div class="line"><a name="l08266"></a><span class="lineno"> 8266</span>&#160;                            chars += <span class="stringliteral">&quot;&#39;&quot;</span>;</div>
<div class="line"><a name="l08267"></a><span class="lineno"> 8267</span>&#160;                        <span class="keywordflow">else</span></div>
<div class="line"><a name="l08268"></a><span class="lineno"> 8268</span>&#160;                            literal = <span class="keyword">true</span>;</div>
<div class="line"><a name="l08269"></a><span class="lineno"> 8269</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08270"></a><span class="lineno"> 8270</span>&#160;                    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l08271"></a><span class="lineno"> 8271</span>&#160;                        chars += format.charAt(iFormat);</div>
<div class="line"><a name="l08272"></a><span class="lineno"> 8272</span>&#160;                }</div>
<div class="line"><a name="l08273"></a><span class="lineno"> 8273</span>&#160;        <span class="keywordflow">return</span> chars;</div>
<div class="line"><a name="l08274"></a><span class="lineno"> 8274</span>&#160;    },</div>
<div class="line"><a name="l08275"></a><span class="lineno"> 8275</span>&#160;</div>
<div class="line"><a name="l08276"></a><span class="lineno"> 8276</span>&#160;    <span class="comment">/* Get a setting value, defaulting if necessary. */</span></div>
<div class="line"><a name="l08277"></a><span class="lineno"> 8277</span>&#160;    _get: <span class="keyword">function</span>(inst, name) {</div>
<div class="line"><a name="l08278"></a><span class="lineno"> 8278</span>&#160;        <span class="keywordflow">return</span> inst.settings[name] !== undefined ?</div>
<div class="line"><a name="l08279"></a><span class="lineno"> 8279</span>&#160;            inst.settings[name] : this._defaults[name];</div>
<div class="line"><a name="l08280"></a><span class="lineno"> 8280</span>&#160;    },</div>
<div class="line"><a name="l08281"></a><span class="lineno"> 8281</span>&#160;</div>
<div class="line"><a name="l08282"></a><span class="lineno"> 8282</span>&#160;    <span class="comment">/* Parse existing date and initialise date picker. */</span></div>
<div class="line"><a name="l08283"></a><span class="lineno"> 8283</span>&#160;    _setDateFromField: <span class="keyword">function</span>(inst, noDefault) {</div>
<div class="line"><a name="l08284"></a><span class="lineno"> 8284</span>&#160;        <span class="keywordflow">if</span> (inst.input.val() == inst.lastVal) {</div>
<div class="line"><a name="l08285"></a><span class="lineno"> 8285</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l08286"></a><span class="lineno"> 8286</span>&#160;        }</div>
<div class="line"><a name="l08287"></a><span class="lineno"> 8287</span>&#160;        var dateFormat = this._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>);</div>
<div class="line"><a name="l08288"></a><span class="lineno"> 8288</span>&#160;        var dates = inst.lastVal = inst.input ? inst.input.val() : null;</div>
<div class="line"><a name="l08289"></a><span class="lineno"> 8289</span>&#160;        var date, defaultDate;</div>
<div class="line"><a name="l08290"></a><span class="lineno"> 8290</span>&#160;        date = defaultDate = this._getDefaultDate(inst);</div>
<div class="line"><a name="l08291"></a><span class="lineno"> 8291</span>&#160;        var settings = this._getFormatConfig(inst);</div>
<div class="line"><a name="l08292"></a><span class="lineno"> 8292</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l08293"></a><span class="lineno"> 8293</span>&#160;            date = this.parseDate(dateFormat, dates, settings) || defaultDate;</div>
<div class="line"><a name="l08294"></a><span class="lineno"> 8294</span>&#160;        } <span class="keywordflow">catch</span> (event) {</div>
<div class="line"><a name="l08295"></a><span class="lineno"> 8295</span>&#160;            this.log(event);</div>
<div class="line"><a name="l08296"></a><span class="lineno"> 8296</span>&#160;            dates = (noDefault ? <span class="stringliteral">&#39;&#39;</span> : dates);</div>
<div class="line"><a name="l08297"></a><span class="lineno"> 8297</span>&#160;        }</div>
<div class="line"><a name="l08298"></a><span class="lineno"> 8298</span>&#160;        inst.selectedDay = date.getDate();</div>
<div class="line"><a name="l08299"></a><span class="lineno"> 8299</span>&#160;        inst.drawMonth = inst.selectedMonth = date.getMonth();</div>
<div class="line"><a name="l08300"></a><span class="lineno"> 8300</span>&#160;        inst.drawYear = inst.selectedYear = date.getFullYear();</div>
<div class="line"><a name="l08301"></a><span class="lineno"> 8301</span>&#160;        inst.currentDay = (dates ? date.getDate() : 0);</div>
<div class="line"><a name="l08302"></a><span class="lineno"> 8302</span>&#160;        inst.currentMonth = (dates ? date.getMonth() : 0);</div>
<div class="line"><a name="l08303"></a><span class="lineno"> 8303</span>&#160;        inst.currentYear = (dates ? date.getFullYear() : 0);</div>
<div class="line"><a name="l08304"></a><span class="lineno"> 8304</span>&#160;        this._adjustInstDate(inst);</div>
<div class="line"><a name="l08305"></a><span class="lineno"> 8305</span>&#160;    },</div>
<div class="line"><a name="l08306"></a><span class="lineno"> 8306</span>&#160;</div>
<div class="line"><a name="l08307"></a><span class="lineno"> 8307</span>&#160;    <span class="comment">/* Retrieve the default date shown on opening. */</span></div>
<div class="line"><a name="l08308"></a><span class="lineno"> 8308</span>&#160;    _getDefaultDate: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l08309"></a><span class="lineno"> 8309</span>&#160;        <span class="keywordflow">return</span> this._restrictMinMax(inst,</div>
<div class="line"><a name="l08310"></a><span class="lineno"> 8310</span>&#160;            this._determineDate(inst, this._get(inst, <span class="stringliteral">&#39;defaultDate&#39;</span>), <span class="keyword">new</span> Date()));</div>
<div class="line"><a name="l08311"></a><span class="lineno"> 8311</span>&#160;    },</div>
<div class="line"><a name="l08312"></a><span class="lineno"> 8312</span>&#160;</div>
<div class="line"><a name="l08313"></a><span class="lineno"> 8313</span>&#160;    <span class="comment">/* A date may be specified as an exact value or a relative one. */</span></div>
<div class="line"><a name="l08314"></a><span class="lineno"> 8314</span>&#160;    _determineDate: <span class="keyword">function</span>(inst, date, defaultDate) {</div>
<div class="line"><a name="l08315"></a><span class="lineno"> 8315</span>&#160;        var offsetNumeric = <span class="keyword">function</span>(offset) {</div>
<div class="line"><a name="l08316"></a><span class="lineno"> 8316</span>&#160;            var date = <span class="keyword">new</span> Date();</div>
<div class="line"><a name="l08317"></a><span class="lineno"> 8317</span>&#160;            date.setDate(date.getDate() + offset);</div>
<div class="line"><a name="l08318"></a><span class="lineno"> 8318</span>&#160;            <span class="keywordflow">return</span> date;</div>
<div class="line"><a name="l08319"></a><span class="lineno"> 8319</span>&#160;        };</div>
<div class="line"><a name="l08320"></a><span class="lineno"> 8320</span>&#160;        var offsetString = <span class="keyword">function</span>(offset) {</div>
<div class="line"><a name="l08321"></a><span class="lineno"> 8321</span>&#160;            <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l08322"></a><span class="lineno"> 8322</span>&#160;                <span class="keywordflow">return</span> $.datepicker.parseDate($.datepicker._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>),</div>
<div class="line"><a name="l08323"></a><span class="lineno"> 8323</span>&#160;                    offset, $.datepicker._getFormatConfig(inst));</div>
<div class="line"><a name="l08324"></a><span class="lineno"> 8324</span>&#160;            }</div>
<div class="line"><a name="l08325"></a><span class="lineno"> 8325</span>&#160;            <span class="keywordflow">catch</span> (e) {</div>
<div class="line"><a name="l08326"></a><span class="lineno"> 8326</span>&#160;                <span class="comment">// Ignore</span></div>
<div class="line"><a name="l08327"></a><span class="lineno"> 8327</span>&#160;            }</div>
<div class="line"><a name="l08328"></a><span class="lineno"> 8328</span>&#160;            var date = (offset.toLowerCase().match(/^c/) ?</div>
<div class="line"><a name="l08329"></a><span class="lineno"> 8329</span>&#160;                $.datepicker._getDate(inst) : null) || <span class="keyword">new</span> Date();</div>
<div class="line"><a name="l08330"></a><span class="lineno"> 8330</span>&#160;            var year = date.getFullYear();</div>
<div class="line"><a name="l08331"></a><span class="lineno"> 8331</span>&#160;            var month = date.getMonth();</div>
<div class="line"><a name="l08332"></a><span class="lineno"> 8332</span>&#160;            var day = date.getDate();</div>
<div class="line"><a name="l08333"></a><span class="lineno"> 8333</span>&#160;            var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;</div>
<div class="line"><a name="l08334"></a><span class="lineno"> 8334</span>&#160;            var matches = pattern.exec(offset);</div>
<div class="line"><a name="l08335"></a><span class="lineno"> 8335</span>&#160;            <span class="keywordflow">while</span> (matches) {</div>
<div class="line"><a name="l08336"></a><span class="lineno"> 8336</span>&#160;                <span class="keywordflow">switch</span> (matches[2] || <span class="charliteral">&#39;d&#39;</span>) {</div>
<div class="line"><a name="l08337"></a><span class="lineno"> 8337</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;d&#39;</span> : <span class="keywordflow">case</span> <span class="charliteral">&#39;D&#39;</span> :</div>
<div class="line"><a name="l08338"></a><span class="lineno"> 8338</span>&#160;                        day += parseInt(matches[1],10); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08339"></a><span class="lineno"> 8339</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;w&#39;</span> : <span class="keywordflow">case</span> <span class="charliteral">&#39;W&#39;</span> :</div>
<div class="line"><a name="l08340"></a><span class="lineno"> 8340</span>&#160;                        day += parseInt(matches[1],10) * 7; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08341"></a><span class="lineno"> 8341</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;m&#39;</span> : <span class="keywordflow">case</span> <span class="charliteral">&#39;M&#39;</span> :</div>
<div class="line"><a name="l08342"></a><span class="lineno"> 8342</span>&#160;                        month += parseInt(matches[1],10);</div>
<div class="line"><a name="l08343"></a><span class="lineno"> 8343</span>&#160;                        day = Math.min(day, $.datepicker._getDaysInMonth(year, month));</div>
<div class="line"><a name="l08344"></a><span class="lineno"> 8344</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08345"></a><span class="lineno"> 8345</span>&#160;                    <span class="keywordflow">case</span> <span class="charliteral">&#39;y&#39;</span>: <span class="keywordflow">case</span> <span class="charliteral">&#39;Y&#39;</span> :</div>
<div class="line"><a name="l08346"></a><span class="lineno"> 8346</span>&#160;                        year += parseInt(matches[1],10);</div>
<div class="line"><a name="l08347"></a><span class="lineno"> 8347</span>&#160;                        day = Math.min(day, $.datepicker._getDaysInMonth(year, month));</div>
<div class="line"><a name="l08348"></a><span class="lineno"> 8348</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l08349"></a><span class="lineno"> 8349</span>&#160;                }</div>
<div class="line"><a name="l08350"></a><span class="lineno"> 8350</span>&#160;                matches = pattern.exec(offset);</div>
<div class="line"><a name="l08351"></a><span class="lineno"> 8351</span>&#160;            }</div>
<div class="line"><a name="l08352"></a><span class="lineno"> 8352</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">new</span> Date(year, month, day);</div>
<div class="line"><a name="l08353"></a><span class="lineno"> 8353</span>&#160;        };</div>
<div class="line"><a name="l08354"></a><span class="lineno"> 8354</span>&#160;        var newDate = (date == null || date === <span class="stringliteral">&#39;&#39;</span> ? defaultDate : (typeof date == <span class="stringliteral">&#39;string&#39;</span> ? offsetString(date) :</div>
<div class="line"><a name="l08355"></a><span class="lineno"> 8355</span>&#160;            (typeof date == <span class="stringliteral">&#39;number&#39;</span> ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));</div>
<div class="line"><a name="l08356"></a><span class="lineno"> 8356</span>&#160;        newDate = (newDate &amp;&amp; newDate.toString() == <span class="stringliteral">&#39;Invalid Date&#39;</span> ? defaultDate : newDate);</div>
<div class="line"><a name="l08357"></a><span class="lineno"> 8357</span>&#160;        <span class="keywordflow">if</span> (newDate) {</div>
<div class="line"><a name="l08358"></a><span class="lineno"> 8358</span>&#160;            newDate.setHours(0);</div>
<div class="line"><a name="l08359"></a><span class="lineno"> 8359</span>&#160;            newDate.setMinutes(0);</div>
<div class="line"><a name="l08360"></a><span class="lineno"> 8360</span>&#160;            newDate.setSeconds(0);</div>
<div class="line"><a name="l08361"></a><span class="lineno"> 8361</span>&#160;            newDate.setMilliseconds(0);</div>
<div class="line"><a name="l08362"></a><span class="lineno"> 8362</span>&#160;        }</div>
<div class="line"><a name="l08363"></a><span class="lineno"> 8363</span>&#160;        <span class="keywordflow">return</span> this._daylightSavingAdjust(newDate);</div>
<div class="line"><a name="l08364"></a><span class="lineno"> 8364</span>&#160;    },</div>
<div class="line"><a name="l08365"></a><span class="lineno"> 8365</span>&#160;</div>
<div class="line"><a name="l08366"></a><span class="lineno"> 8366</span>&#160;    <span class="comment">/* Handle switch to/from daylight saving.</span></div>
<div class="line"><a name="l08367"></a><span class="lineno"> 8367</span>&#160;<span class="comment">       Hours may be non-zero on daylight saving cut-over:</span></div>
<div class="line"><a name="l08368"></a><span class="lineno"> 8368</span>&#160;<span class="comment">       &gt; 12 when midnight changeover, but then cannot generate</span></div>
<div class="line"><a name="l08369"></a><span class="lineno"> 8369</span>&#160;<span class="comment">       midnight datetime, so jump to 1AM, otherwise reset.</span></div>
<div class="line"><a name="l08370"></a><span class="lineno"> 8370</span>&#160;<span class="comment">       @param  date  (Date) the date to check</span></div>
<div class="line"><a name="l08371"></a><span class="lineno"> 8371</span>&#160;<span class="comment">       @return  (Date) the corrected date */</span></div>
<div class="line"><a name="l08372"></a><span class="lineno"> 8372</span>&#160;    _daylightSavingAdjust: <span class="keyword">function</span>(date) {</div>
<div class="line"><a name="l08373"></a><span class="lineno"> 8373</span>&#160;        <span class="keywordflow">if</span> (!date) <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l08374"></a><span class="lineno"> 8374</span>&#160;        date.setHours(date.getHours() &gt; 12 ? date.getHours() + 2 : 0);</div>
<div class="line"><a name="l08375"></a><span class="lineno"> 8375</span>&#160;        <span class="keywordflow">return</span> date;</div>
<div class="line"><a name="l08376"></a><span class="lineno"> 8376</span>&#160;    },</div>
<div class="line"><a name="l08377"></a><span class="lineno"> 8377</span>&#160;</div>
<div class="line"><a name="l08378"></a><span class="lineno"> 8378</span>&#160;    <span class="comment">/* Set the date(s) directly. */</span></div>
<div class="line"><a name="l08379"></a><span class="lineno"> 8379</span>&#160;    _setDate: <span class="keyword">function</span>(inst, date, noChange) {</div>
<div class="line"><a name="l08380"></a><span class="lineno"> 8380</span>&#160;        var clear = !date;</div>
<div class="line"><a name="l08381"></a><span class="lineno"> 8381</span>&#160;        var origMonth = inst.selectedMonth;</div>
<div class="line"><a name="l08382"></a><span class="lineno"> 8382</span>&#160;        var origYear = inst.selectedYear;</div>
<div class="line"><a name="l08383"></a><span class="lineno"> 8383</span>&#160;        var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, <span class="keyword">new</span> Date()));</div>
<div class="line"><a name="l08384"></a><span class="lineno"> 8384</span>&#160;        inst.selectedDay = inst.currentDay = newDate.getDate();</div>
<div class="line"><a name="l08385"></a><span class="lineno"> 8385</span>&#160;        inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();</div>
<div class="line"><a name="l08386"></a><span class="lineno"> 8386</span>&#160;        inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();</div>
<div class="line"><a name="l08387"></a><span class="lineno"> 8387</span>&#160;        <span class="keywordflow">if</span> ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) &amp;&amp; !noChange)</div>
<div class="line"><a name="l08388"></a><span class="lineno"> 8388</span>&#160;            this._notifyChange(inst);</div>
<div class="line"><a name="l08389"></a><span class="lineno"> 8389</span>&#160;        this._adjustInstDate(inst);</div>
<div class="line"><a name="l08390"></a><span class="lineno"> 8390</span>&#160;        <span class="keywordflow">if</span> (inst.input) {</div>
<div class="line"><a name="l08391"></a><span class="lineno"> 8391</span>&#160;            inst.input.val(clear ? <span class="stringliteral">&#39;&#39;</span> : this._formatDate(inst));</div>
<div class="line"><a name="l08392"></a><span class="lineno"> 8392</span>&#160;        }</div>
<div class="line"><a name="l08393"></a><span class="lineno"> 8393</span>&#160;    },</div>
<div class="line"><a name="l08394"></a><span class="lineno"> 8394</span>&#160;</div>
<div class="line"><a name="l08395"></a><span class="lineno"> 8395</span>&#160;    <span class="comment">/* Retrieve the date(s) directly. */</span></div>
<div class="line"><a name="l08396"></a><span class="lineno"> 8396</span>&#160;    _getDate: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l08397"></a><span class="lineno"> 8397</span>&#160;        var startDate = (!inst.currentYear || (inst.input &amp;&amp; inst.input.val() == <span class="stringliteral">&#39;&#39;</span>) ? null :</div>
<div class="line"><a name="l08398"></a><span class="lineno"> 8398</span>&#160;            this._daylightSavingAdjust(<span class="keyword">new</span> Date(</div>
<div class="line"><a name="l08399"></a><span class="lineno"> 8399</span>&#160;            inst.currentYear, inst.currentMonth, inst.currentDay)));</div>
<div class="line"><a name="l08400"></a><span class="lineno"> 8400</span>&#160;            <span class="keywordflow">return</span> startDate;</div>
<div class="line"><a name="l08401"></a><span class="lineno"> 8401</span>&#160;    },</div>
<div class="line"><a name="l08402"></a><span class="lineno"> 8402</span>&#160;</div>
<div class="line"><a name="l08403"></a><span class="lineno"> 8403</span>&#160;    <span class="comment">/* Generate the HTML for the current state of the date picker. */</span></div>
<div class="line"><a name="l08404"></a><span class="lineno"> 8404</span>&#160;    _generateHTML: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l08405"></a><span class="lineno"> 8405</span>&#160;        var today = <span class="keyword">new</span> Date();</div>
<div class="line"><a name="l08406"></a><span class="lineno"> 8406</span>&#160;        today = this._daylightSavingAdjust(</div>
<div class="line"><a name="l08407"></a><span class="lineno"> 8407</span>&#160;            <span class="keyword">new</span> Date(today.getFullYear(), today.getMonth(), today.getDate())); <span class="comment">// clear time</span></div>
<div class="line"><a name="l08408"></a><span class="lineno"> 8408</span>&#160;        var isRTL = this._get(inst, <span class="stringliteral">&#39;isRTL&#39;</span>);</div>
<div class="line"><a name="l08409"></a><span class="lineno"> 8409</span>&#160;        var showButtonPanel = this._get(inst, <span class="stringliteral">&#39;showButtonPanel&#39;</span>);</div>
<div class="line"><a name="l08410"></a><span class="lineno"> 8410</span>&#160;        var hideIfNoPrevNext = this._get(inst, <span class="stringliteral">&#39;hideIfNoPrevNext&#39;</span>);</div>
<div class="line"><a name="l08411"></a><span class="lineno"> 8411</span>&#160;        var navigationAsDateFormat = this._get(inst, <span class="stringliteral">&#39;navigationAsDateFormat&#39;</span>);</div>
<div class="line"><a name="l08412"></a><span class="lineno"> 8412</span>&#160;        var numMonths = this._getNumberOfMonths(inst);</div>
<div class="line"><a name="l08413"></a><span class="lineno"> 8413</span>&#160;        var showCurrentAtPos = this._get(inst, <span class="stringliteral">&#39;showCurrentAtPos&#39;</span>);</div>
<div class="line"><a name="l08414"></a><span class="lineno"> 8414</span>&#160;        var stepMonths = this._get(inst, <span class="stringliteral">&#39;stepMonths&#39;</span>);</div>
<div class="line"><a name="l08415"></a><span class="lineno"> 8415</span>&#160;        var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);</div>
<div class="line"><a name="l08416"></a><span class="lineno"> 8416</span>&#160;        var currentDate = this._daylightSavingAdjust((!inst.currentDay ? <span class="keyword">new</span> Date(9999, 9, 9) :</div>
<div class="line"><a name="l08417"></a><span class="lineno"> 8417</span>&#160;            <span class="keyword">new</span> Date(inst.currentYear, inst.currentMonth, inst.currentDay)));</div>
<div class="line"><a name="l08418"></a><span class="lineno"> 8418</span>&#160;        var minDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;min&#39;</span>);</div>
<div class="line"><a name="l08419"></a><span class="lineno"> 8419</span>&#160;        var maxDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;max&#39;</span>);</div>
<div class="line"><a name="l08420"></a><span class="lineno"> 8420</span>&#160;        var drawMonth = inst.drawMonth - showCurrentAtPos;</div>
<div class="line"><a name="l08421"></a><span class="lineno"> 8421</span>&#160;        var drawYear = inst.drawYear;</div>
<div class="line"><a name="l08422"></a><span class="lineno"> 8422</span>&#160;        <span class="keywordflow">if</span> (drawMonth &lt; 0) {</div>
<div class="line"><a name="l08423"></a><span class="lineno"> 8423</span>&#160;            drawMonth += 12;</div>
<div class="line"><a name="l08424"></a><span class="lineno"> 8424</span>&#160;            drawYear--;</div>
<div class="line"><a name="l08425"></a><span class="lineno"> 8425</span>&#160;        }</div>
<div class="line"><a name="l08426"></a><span class="lineno"> 8426</span>&#160;        <span class="keywordflow">if</span> (maxDate) {</div>
<div class="line"><a name="l08427"></a><span class="lineno"> 8427</span>&#160;            var maxDraw = this._daylightSavingAdjust(<span class="keyword">new</span> Date(maxDate.getFullYear(),</div>
<div class="line"><a name="l08428"></a><span class="lineno"> 8428</span>&#160;                maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));</div>
<div class="line"><a name="l08429"></a><span class="lineno"> 8429</span>&#160;            maxDraw = (minDate &amp;&amp; maxDraw &lt; minDate ? minDate : maxDraw);</div>
<div class="line"><a name="l08430"></a><span class="lineno"> 8430</span>&#160;            <span class="keywordflow">while</span> (this._daylightSavingAdjust(<span class="keyword">new</span> Date(drawYear, drawMonth, 1)) &gt; maxDraw) {</div>
<div class="line"><a name="l08431"></a><span class="lineno"> 8431</span>&#160;                drawMonth--;</div>
<div class="line"><a name="l08432"></a><span class="lineno"> 8432</span>&#160;                <span class="keywordflow">if</span> (drawMonth &lt; 0) {</div>
<div class="line"><a name="l08433"></a><span class="lineno"> 8433</span>&#160;                    drawMonth = 11;</div>
<div class="line"><a name="l08434"></a><span class="lineno"> 8434</span>&#160;                    drawYear--;</div>
<div class="line"><a name="l08435"></a><span class="lineno"> 8435</span>&#160;                }</div>
<div class="line"><a name="l08436"></a><span class="lineno"> 8436</span>&#160;            }</div>
<div class="line"><a name="l08437"></a><span class="lineno"> 8437</span>&#160;        }</div>
<div class="line"><a name="l08438"></a><span class="lineno"> 8438</span>&#160;        inst.drawMonth = drawMonth;</div>
<div class="line"><a name="l08439"></a><span class="lineno"> 8439</span>&#160;        inst.drawYear = drawYear;</div>
<div class="line"><a name="l08440"></a><span class="lineno"> 8440</span>&#160;        var prevText = this._get(inst, <span class="stringliteral">&#39;prevText&#39;</span>);</div>
<div class="line"><a name="l08441"></a><span class="lineno"> 8441</span>&#160;        prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,</div>
<div class="line"><a name="l08442"></a><span class="lineno"> 8442</span>&#160;            this._daylightSavingAdjust(<span class="keyword">new</span> Date(drawYear, drawMonth - stepMonths, 1)),</div>
<div class="line"><a name="l08443"></a><span class="lineno"> 8443</span>&#160;            this._getFormatConfig(inst)));</div>
<div class="line"><a name="l08444"></a><span class="lineno"> 8444</span>&#160;        var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?</div>
<div class="line"><a name="l08445"></a><span class="lineno"> 8445</span>&#160;            <span class="stringliteral">&#39;&lt;a class=&quot;ui-datepicker-prev ui-corner-all&quot; onclick=&quot;DP_jQuery_&#39;</span> + dpuuid +</div>
<div class="line"><a name="l08446"></a><span class="lineno"> 8446</span>&#160;            <span class="stringliteral">&#39;.datepicker._adjustDate(\&#39;#&#39;</span> + inst.id + <span class="charliteral">&#39;\&#39;</span>, -<span class="stringliteral">&#39; + stepMonths + &#39;</span>, \<span class="stringliteral">&#39;M\&#39;);&quot;&#39;</span> +</div>
<div class="line"><a name="l08447"></a><span class="lineno"> 8447</span>&#160;            <span class="stringliteral">&#39; title=&quot;&#39;</span> + prevText + <span class="stringliteral">&#39;&quot;&gt;&lt;span class=&quot;ui-icon ui-icon-circle-triangle-&#39;</span> + ( isRTL ? <span class="charliteral">&#39;e&#39;</span> : <span class="charliteral">&#39;w&#39;</span>) + <span class="stringliteral">&#39;&quot;&gt;&#39;</span> + prevText + <span class="stringliteral">&#39;&lt;/span&gt;&lt;/a&gt;&#39;</span> :</div>
<div class="line"><a name="l08448"></a><span class="lineno"> 8448</span>&#160;            (hideIfNoPrevNext ? <span class="stringliteral">&#39;&#39;</span> : <span class="stringliteral">&#39;&lt;a class=&quot;ui-datepicker-prev ui-corner-all ui-state-disabled&quot; title=&quot;&#39;</span>+ prevText +<span class="stringliteral">&#39;&quot;&gt;&lt;span class=&quot;ui-icon ui-icon-circle-triangle-&#39;</span> + ( isRTL ? <span class="charliteral">&#39;e&#39;</span> : <span class="charliteral">&#39;w&#39;</span>) + <span class="stringliteral">&#39;&quot;&gt;&#39;</span> + prevText + <span class="stringliteral">&#39;&lt;/span&gt;&lt;/a&gt;&#39;</span>));</div>
<div class="line"><a name="l08449"></a><span class="lineno"> 8449</span>&#160;        var nextText = this._get(inst, <span class="stringliteral">&#39;nextText&#39;</span>);</div>
<div class="line"><a name="l08450"></a><span class="lineno"> 8450</span>&#160;        nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,</div>
<div class="line"><a name="l08451"></a><span class="lineno"> 8451</span>&#160;            this._daylightSavingAdjust(<span class="keyword">new</span> Date(drawYear, drawMonth + stepMonths, 1)),</div>
<div class="line"><a name="l08452"></a><span class="lineno"> 8452</span>&#160;            this._getFormatConfig(inst)));</div>
<div class="line"><a name="l08453"></a><span class="lineno"> 8453</span>&#160;        var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?</div>
<div class="line"><a name="l08454"></a><span class="lineno"> 8454</span>&#160;            <span class="stringliteral">&#39;&lt;a class=&quot;ui-datepicker-next ui-corner-all&quot; onclick=&quot;DP_jQuery_&#39;</span> + dpuuid +</div>
<div class="line"><a name="l08455"></a><span class="lineno"> 8455</span>&#160;            <span class="stringliteral">&#39;.datepicker._adjustDate(\&#39;#&#39;</span> + inst.id + <span class="charliteral">&#39;\&#39;</span>, +<span class="stringliteral">&#39; + stepMonths + &#39;</span>, \<span class="stringliteral">&#39;M\&#39;);&quot;&#39;</span> +</div>
<div class="line"><a name="l08456"></a><span class="lineno"> 8456</span>&#160;            <span class="stringliteral">&#39; title=&quot;&#39;</span> + nextText + <span class="stringliteral">&#39;&quot;&gt;&lt;span class=&quot;ui-icon ui-icon-circle-triangle-&#39;</span> + ( isRTL ? <span class="charliteral">&#39;w&#39;</span> : <span class="charliteral">&#39;e&#39;</span>) + <span class="stringliteral">&#39;&quot;&gt;&#39;</span> + nextText + <span class="stringliteral">&#39;&lt;/span&gt;&lt;/a&gt;&#39;</span> :</div>
<div class="line"><a name="l08457"></a><span class="lineno"> 8457</span>&#160;            (hideIfNoPrevNext ? <span class="stringliteral">&#39;&#39;</span> : <span class="stringliteral">&#39;&lt;a class=&quot;ui-datepicker-next ui-corner-all ui-state-disabled&quot; title=&quot;&#39;</span>+ nextText + <span class="stringliteral">&#39;&quot;&gt;&lt;span class=&quot;ui-icon ui-icon-circle-triangle-&#39;</span> + ( isRTL ? <span class="charliteral">&#39;w&#39;</span> : <span class="charliteral">&#39;e&#39;</span>) + <span class="stringliteral">&#39;&quot;&gt;&#39;</span> + nextText + <span class="stringliteral">&#39;&lt;/span&gt;&lt;/a&gt;&#39;</span>));</div>
<div class="line"><a name="l08458"></a><span class="lineno"> 8458</span>&#160;        var currentText = this._get(inst, <span class="stringliteral">&#39;currentText&#39;</span>);</div>
<div class="line"><a name="l08459"></a><span class="lineno"> 8459</span>&#160;        var gotoDate = (this._get(inst, <span class="stringliteral">&#39;gotoCurrent&#39;</span>) &amp;&amp; inst.currentDay ? currentDate : today);</div>
<div class="line"><a name="l08460"></a><span class="lineno"> 8460</span>&#160;        currentText = (!navigationAsDateFormat ? currentText :</div>
<div class="line"><a name="l08461"></a><span class="lineno"> 8461</span>&#160;            this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));</div>
<div class="line"><a name="l08462"></a><span class="lineno"> 8462</span>&#160;        var controls = (!inst.inline ? <span class="stringliteral">&#39;&lt;button type=&quot;button&quot; class=&quot;ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all&quot; onclick=&quot;DP_jQuery_&#39;</span> + dpuuid +</div>
<div class="line"><a name="l08463"></a><span class="lineno"> 8463</span>&#160;            <span class="stringliteral">&#39;.datepicker._hideDatepicker();&quot;&gt;&#39;</span> + this._get(inst, <span class="stringliteral">&#39;closeText&#39;</span>) + <span class="stringliteral">&#39;&lt;/button&gt;&#39;</span> : <span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l08464"></a><span class="lineno"> 8464</span>&#160;        var buttonPanel = (showButtonPanel) ? <span class="stringliteral">&#39;&lt;div class=&quot;ui-datepicker-buttonpane ui-widget-content&quot;&gt;&#39;</span> + (isRTL ? controls : <span class="stringliteral">&#39;&#39;</span>) +</div>
<div class="line"><a name="l08465"></a><span class="lineno"> 8465</span>&#160;            (this._isInRange(inst, gotoDate) ? <span class="stringliteral">&#39;&lt;button type=&quot;button&quot; class=&quot;ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all&quot; onclick=&quot;DP_jQuery_&#39;</span> + dpuuid +</div>
<div class="line"><a name="l08466"></a><span class="lineno"> 8466</span>&#160;            <span class="stringliteral">&#39;.datepicker._gotoToday(\&#39;#&#39;</span> + inst.id + <span class="charliteral">&#39;\&#39;</span>);<span class="stringliteral">&quot;&#39; +</span></div>
<div class="line"><a name="l08467"></a><span class="lineno"> 8467</span>&#160;<span class="stringliteral">            &#39;&gt;&#39; + currentText + &#39;&lt;/button&gt;&#39; : &#39;&#39;) + (isRTL ? &#39;&#39; : controls) + &#39;&lt;/div&gt;&#39; : &#39;&#39;;</span></div>
<div class="line"><a name="l08468"></a><span class="lineno"> 8468</span>&#160;<span class="stringliteral">        var firstDay = parseInt(this._get(inst, &#39;firstDay&#39;),10);</span></div>
<div class="line"><a name="l08469"></a><span class="lineno"> 8469</span>&#160;<span class="stringliteral">        firstDay = (isNaN(firstDay) ? 0 : firstDay);</span></div>
<div class="line"><a name="l08470"></a><span class="lineno"> 8470</span>&#160;<span class="stringliteral">        var showWeek = this._get(inst, &#39;showWeek&#39;);</span></div>
<div class="line"><a name="l08471"></a><span class="lineno"> 8471</span>&#160;<span class="stringliteral">        var dayNames = this._get(inst, &#39;dayNames&#39;);</span></div>
<div class="line"><a name="l08472"></a><span class="lineno"> 8472</span>&#160;<span class="stringliteral">        var dayNamesShort = this._get(inst, &#39;dayNamesShort&#39;);</span></div>
<div class="line"><a name="l08473"></a><span class="lineno"> 8473</span>&#160;<span class="stringliteral">        var dayNamesMin = this._get(inst, &#39;dayNamesMin&#39;);</span></div>
<div class="line"><a name="l08474"></a><span class="lineno"> 8474</span>&#160;<span class="stringliteral">        var monthNames = this._get(inst, &#39;monthNames&#39;);</span></div>
<div class="line"><a name="l08475"></a><span class="lineno"> 8475</span>&#160;<span class="stringliteral">        var monthNamesShort = this._get(inst, &#39;monthNamesShort&#39;);</span></div>
<div class="line"><a name="l08476"></a><span class="lineno"> 8476</span>&#160;<span class="stringliteral">        var beforeShowDay = this._get(inst, &#39;beforeShowDay&#39;);</span></div>
<div class="line"><a name="l08477"></a><span class="lineno"> 8477</span>&#160;<span class="stringliteral">        var showOtherMonths = this._get(inst, &#39;showOtherMonths&#39;);</span></div>
<div class="line"><a name="l08478"></a><span class="lineno"> 8478</span>&#160;<span class="stringliteral">        var selectOtherMonths = this._get(inst, &#39;selectOtherMonths&#39;);</span></div>
<div class="line"><a name="l08479"></a><span class="lineno"> 8479</span>&#160;<span class="stringliteral">        var calculateWeek = this._get(inst, &#39;calculateWeek&#39;) || this.iso8601Week;</span></div>
<div class="line"><a name="l08480"></a><span class="lineno"> 8480</span>&#160;<span class="stringliteral">        var defaultDate = this._getDefaultDate(inst);</span></div>
<div class="line"><a name="l08481"></a><span class="lineno"> 8481</span>&#160;<span class="stringliteral">        var html = &#39;&#39;;</span></div>
<div class="line"><a name="l08482"></a><span class="lineno"> 8482</span>&#160;<span class="stringliteral">        for (var row = 0; row &lt; numMonths[0]; row++) {</span></div>
<div class="line"><a name="l08483"></a><span class="lineno"> 8483</span>&#160;<span class="stringliteral">            var group = &#39;&#39;;</span></div>
<div class="line"><a name="l08484"></a><span class="lineno"> 8484</span>&#160;<span class="stringliteral">            this.maxRows = 4;</span></div>
<div class="line"><a name="l08485"></a><span class="lineno"> 8485</span>&#160;<span class="stringliteral">            for (var col = 0; col &lt; numMonths[1]; col++) {</span></div>
<div class="line"><a name="l08486"></a><span class="lineno"> 8486</span>&#160;<span class="stringliteral">                var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));</span></div>
<div class="line"><a name="l08487"></a><span class="lineno"> 8487</span>&#160;<span class="stringliteral">                var cornerClass = &#39; ui-corner-all&#39;;</span></div>
<div class="line"><a name="l08488"></a><span class="lineno"> 8488</span>&#160;<span class="stringliteral">                var calender = &#39;&#39;;</span></div>
<div class="line"><a name="l08489"></a><span class="lineno"> 8489</span>&#160;<span class="stringliteral">                if (isMultiMonth) {</span></div>
<div class="line"><a name="l08490"></a><span class="lineno"> 8490</span>&#160;<span class="stringliteral">                    calender += &#39;&lt;div class=&quot;</span>ui-datepicker-group<span class="stringliteral">&#39;;</span></div>
<div class="line"><a name="l08491"></a><span class="lineno"> 8491</span>&#160;<span class="stringliteral">                    if (numMonths[1] &gt; 1)</span></div>
<div class="line"><a name="l08492"></a><span class="lineno"> 8492</span>&#160;<span class="stringliteral">                        switch (col) {</span></div>
<div class="line"><a name="l08493"></a><span class="lineno"> 8493</span>&#160;<span class="stringliteral">                            case 0: calender += &#39;</span> ui-datepicker-group-first<span class="stringliteral">&#39;;</span></div>
<div class="line"><a name="l08494"></a><span class="lineno"> 8494</span>&#160;<span class="stringliteral">                                cornerClass = &#39;</span> ui-corner-<span class="stringliteral">&#39; + (isRTL ? &#39;</span>right<span class="stringliteral">&#39; : &#39;</span>left<span class="stringliteral">&#39;); break;</span></div>
<div class="line"><a name="l08495"></a><span class="lineno"> 8495</span>&#160;<span class="stringliteral">                            case numMonths[1]-1: calender += &#39;</span> ui-datepicker-group-last<span class="stringliteral">&#39;;</span></div>
<div class="line"><a name="l08496"></a><span class="lineno"> 8496</span>&#160;<span class="stringliteral">                                cornerClass = &#39;</span> ui-corner-<span class="stringliteral">&#39; + (isRTL ? &#39;</span>left<span class="stringliteral">&#39; : &#39;</span>right<span class="stringliteral">&#39;); break;</span></div>
<div class="line"><a name="l08497"></a><span class="lineno"> 8497</span>&#160;<span class="stringliteral">                            default: calender += &#39;</span> ui-datepicker-group-middle<span class="stringliteral">&#39;; cornerClass = &#39;</span><span class="stringliteral">&#39;; break;</span></div>
<div class="line"><a name="l08498"></a><span class="lineno"> 8498</span>&#160;<span class="stringliteral">                        }</span></div>
<div class="line"><a name="l08499"></a><span class="lineno"> 8499</span>&#160;<span class="stringliteral">                    calender += &#39;</span><span class="stringliteral">&quot;&gt;&#39;;</span></div>
<div class="line"><a name="l08500"></a><span class="lineno"> 8500</span>&#160;<span class="stringliteral">                }</span></div>
<div class="line"><a name="l08501"></a><span class="lineno"> 8501</span>&#160;<span class="stringliteral">                calender += &#39;&lt;div class=&quot;</span>ui-datepicker-header ui-widget-header ui-helper-clearfix<span class="stringliteral">&#39; + cornerClass + &#39;</span><span class="stringliteral">&quot;&gt;&#39; +</span></div>
<div class="line"><a name="l08502"></a><span class="lineno"> 8502</span>&#160;<span class="stringliteral">                    (/all|left/.test(cornerClass) &amp;&amp; row == 0 ? (isRTL ? next : prev) : &#39;&#39;) +</span></div>
<div class="line"><a name="l08503"></a><span class="lineno"> 8503</span>&#160;<span class="stringliteral">                    (/all|right/.test(cornerClass) &amp;&amp; row == 0 ? (isRTL ? prev : next) : &#39;&#39;) +</span></div>
<div class="line"><a name="l08504"></a><span class="lineno"> 8504</span>&#160;<span class="stringliteral">                    this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,</span></div>
<div class="line"><a name="l08505"></a><span class="lineno"> 8505</span>&#160;<span class="stringliteral">                    row &gt; 0 || col &gt; 0, monthNames, monthNamesShort) + // draw month headers</span></div>
<div class="line"><a name="l08506"></a><span class="lineno"> 8506</span>&#160;<span class="stringliteral">                    &#39;&lt;/div&gt;&lt;table class=&quot;</span>ui-datepicker-calendar<span class="stringliteral">&quot;&gt;&lt;thead&gt;&#39; +</span></div>
<div class="line"><a name="l08507"></a><span class="lineno"> 8507</span>&#160;<span class="stringliteral">                    &#39;&lt;tr&gt;&#39;;</span></div>
<div class="line"><a name="l08508"></a><span class="lineno"> 8508</span>&#160;<span class="stringliteral">                var thead = (showWeek ? &#39;&lt;th class=&quot;</span>ui-datepicker-week-col<span class="stringliteral">&quot;&gt;&#39; + this._get(inst, &#39;weekHeader&#39;) + &#39;&lt;/th&gt;&#39; : &#39;&#39;);</span></div>
<div class="line"><a name="l08509"></a><span class="lineno"> 8509</span>&#160;<span class="stringliteral">                for (var dow = 0; dow &lt; 7; dow++) { // days of the week</span></div>
<div class="line"><a name="l08510"></a><span class="lineno"> 8510</span>&#160;<span class="stringliteral">                    var day = (dow + firstDay) % 7;</span></div>
<div class="line"><a name="l08511"></a><span class="lineno"> 8511</span>&#160;<span class="stringliteral">                    thead += &#39;&lt;th&#39; + ((dow + firstDay + 6) % 7 &gt;= 5 ? &#39; class=&quot;</span>ui-datepicker-week-end<span class="stringliteral">&quot;&#39; : &#39;&#39;) + &#39;&gt;&#39; +</span></div>
<div class="line"><a name="l08512"></a><span class="lineno"> 8512</span>&#160;<span class="stringliteral">                        &#39;&lt;span title=&quot;</span><span class="stringliteral">&#39; + dayNames[day] + &#39;</span><span class="stringliteral">&quot;&gt;&#39; + dayNamesMin[day] + &#39;&lt;/span&gt;&lt;/th&gt;&#39;;</span></div>
<div class="line"><a name="l08513"></a><span class="lineno"> 8513</span>&#160;<span class="stringliteral">                }</span></div>
<div class="line"><a name="l08514"></a><span class="lineno"> 8514</span>&#160;<span class="stringliteral">                calender += thead + &#39;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&#39;;</span></div>
<div class="line"><a name="l08515"></a><span class="lineno"> 8515</span>&#160;<span class="stringliteral">                var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);</span></div>
<div class="line"><a name="l08516"></a><span class="lineno"> 8516</span>&#160;<span class="stringliteral">                if (drawYear == inst.selectedYear &amp;&amp; drawMonth == inst.selectedMonth)</span></div>
<div class="line"><a name="l08517"></a><span class="lineno"> 8517</span>&#160;<span class="stringliteral">                    inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);</span></div>
<div class="line"><a name="l08518"></a><span class="lineno"> 8518</span>&#160;<span class="stringliteral">                var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;</span></div>
<div class="line"><a name="l08519"></a><span class="lineno"> 8519</span>&#160;<span class="stringliteral">                var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate</span></div>
<div class="line"><a name="l08520"></a><span class="lineno"> 8520</span>&#160;<span class="stringliteral">                var numRows = (isMultiMonth ? this.maxRows &gt; curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)</span></div>
<div class="line"><a name="l08521"></a><span class="lineno"> 8521</span>&#160;<span class="stringliteral">                this.maxRows = numRows;</span></div>
<div class="line"><a name="l08522"></a><span class="lineno"> 8522</span>&#160;<span class="stringliteral">                var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));</span></div>
<div class="line"><a name="l08523"></a><span class="lineno"> 8523</span>&#160;<span class="stringliteral">                for (var dRow = 0; dRow &lt; numRows; dRow++) { // create date picker rows</span></div>
<div class="line"><a name="l08524"></a><span class="lineno"> 8524</span>&#160;<span class="stringliteral">                    calender += &#39;&lt;tr&gt;&#39;;</span></div>
<div class="line"><a name="l08525"></a><span class="lineno"> 8525</span>&#160;<span class="stringliteral">                    var tbody = (!showWeek ? &#39;&#39; : &#39;&lt;td class=&quot;</span>ui-datepicker-week-col<span class="stringliteral">&quot;&gt;&#39; +</span></div>
<div class="line"><a name="l08526"></a><span class="lineno"> 8526</span>&#160;<span class="stringliteral">                        this._get(inst, &#39;calculateWeek&#39;)(printDate) + &#39;&lt;/td&gt;&#39;);</span></div>
<div class="line"><a name="l08527"></a><span class="lineno"> 8527</span>&#160;<span class="stringliteral">                    for (var dow = 0; dow &lt; 7; dow++) { // create date picker days</span></div>
<div class="line"><a name="l08528"></a><span class="lineno"> 8528</span>&#160;<span class="stringliteral">                        var daySettings = (beforeShowDay ?</span></div>
<div class="line"><a name="l08529"></a><span class="lineno"> 8529</span>&#160;<span class="stringliteral">                            beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, &#39;&#39;]);</span></div>
<div class="line"><a name="l08530"></a><span class="lineno"> 8530</span>&#160;<span class="stringliteral">                        var otherMonth = (printDate.getMonth() != drawMonth);</span></div>
<div class="line"><a name="l08531"></a><span class="lineno"> 8531</span>&#160;<span class="stringliteral">                        var unselectable = (otherMonth &amp;&amp; !selectOtherMonths) || !daySettings[0] ||</span></div>
<div class="line"><a name="l08532"></a><span class="lineno"> 8532</span>&#160;<span class="stringliteral">                            (minDate &amp;&amp; printDate &lt; minDate) || (maxDate &amp;&amp; printDate &gt; maxDate);</span></div>
<div class="line"><a name="l08533"></a><span class="lineno"> 8533</span>&#160;<span class="stringliteral">                        tbody += &#39;&lt;td class=&quot;</span><span class="stringliteral">&#39; +</span></div>
<div class="line"><a name="l08534"></a><span class="lineno"> 8534</span>&#160;<span class="stringliteral">                            ((dow + firstDay + 6) % 7 &gt;= 5 ? &#39;</span> ui-datepicker-week-end<span class="stringliteral">&#39; : &#39;</span><span class="stringliteral">&#39;) + // highlight weekends</span></div>
<div class="line"><a name="l08535"></a><span class="lineno"> 8535</span>&#160;<span class="stringliteral">                            (otherMonth ? &#39;</span> ui-datepicker-other-month<span class="stringliteral">&#39; : &#39;</span><span class="stringliteral">&#39;) + // highlight days from other months</span></div>
<div class="line"><a name="l08536"></a><span class="lineno"> 8536</span>&#160;<span class="stringliteral">                            ((printDate.getTime() == selectedDate.getTime() &amp;&amp; drawMonth == inst.selectedMonth &amp;&amp; inst._keyEvent) || // user pressed key</span></div>
<div class="line"><a name="l08537"></a><span class="lineno"> 8537</span>&#160;<span class="stringliteral">                            (defaultDate.getTime() == printDate.getTime() &amp;&amp; defaultDate.getTime() == selectedDate.getTime()) ?</span></div>
<div class="line"><a name="l08538"></a><span class="lineno"> 8538</span>&#160;<span class="stringliteral">                            // or defaultDate is current printedDate and defaultDate is selectedDate</span></div>
<div class="line"><a name="l08539"></a><span class="lineno"> 8539</span>&#160;<span class="stringliteral">                            &#39;</span> <span class="stringliteral">&#39; + this._dayOverClass : &#39;</span><span class="stringliteral">&#39;) + // highlight selected day</span></div>
<div class="line"><a name="l08540"></a><span class="lineno"> 8540</span>&#160;<span class="stringliteral">                            (unselectable ? &#39;</span> <span class="stringliteral">&#39; + this._unselectableClass + &#39;</span> ui-state-disabled<span class="stringliteral">&#39;: &#39;</span><span class="stringliteral">&#39;) +  // highlight unselectable days</span></div>
<div class="line"><a name="l08541"></a><span class="lineno"> 8541</span>&#160;<span class="stringliteral">                            (otherMonth &amp;&amp; !showOtherMonths ? &#39;</span><span class="stringliteral">&#39; : &#39;</span> <span class="stringliteral">&#39; + daySettings[1] + // highlight custom dates</span></div>
<div class="line"><a name="l08542"></a><span class="lineno"> 8542</span>&#160;<span class="stringliteral">                            (printDate.getTime() == currentDate.getTime() ? &#39;</span> <span class="stringliteral">&#39; + this._currentClass : &#39;</span><span class="stringliteral">&#39;) + // highlight selected day</span></div>
<div class="line"><a name="l08543"></a><span class="lineno"> 8543</span>&#160;<span class="stringliteral">                            (printDate.getTime() == today.getTime() ? &#39;</span> ui-datepicker-today<span class="stringliteral">&#39; : &#39;</span><span class="stringliteral">&#39;)) + &#39;</span><span class="stringliteral">&quot;&#39; + // highlight today (if different)</span></div>
<div class="line"><a name="l08544"></a><span class="lineno"> 8544</span>&#160;<span class="stringliteral">                            ((!otherMonth || showOtherMonths) &amp;&amp; daySettings[2] ? &#39; title=&quot;</span><span class="stringliteral">&#39; + daySettings[2] + &#39;</span><span class="stringliteral">&quot;&#39; : &#39;&#39;) + // cell title</span></div>
<div class="line"><a name="l08545"></a><span class="lineno"> 8545</span>&#160;<span class="stringliteral">                            (unselectable ? &#39;&#39; : &#39; onclick=&quot;</span>DP_jQuery_<span class="stringliteral">&#39; + dpuuid + &#39;</span>.datepicker._selectDay(\<span class="charliteral">&#39;#&#39;</span> +</div>
<div class="line"><a name="l08546"></a><span class="lineno"> 8546</span>&#160;                            inst.id + <span class="charliteral">&#39;\&#39;</span>,<span class="stringliteral">&#39; + printDate.getMonth() + &#39;</span>,<span class="stringliteral">&#39; + printDate.getFullYear() + &#39;</span>, <span class="keyword">this</span>);<span class="keywordflow">return</span> <span class="keyword">false</span>;<span class="stringliteral">&quot;&#39;) + &#39;&gt;&#39; + // actions</span></div>
<div class="line"><a name="l08547"></a><span class="lineno"> 8547</span>&#160;<span class="stringliteral">                            (otherMonth &amp;&amp; !showOtherMonths ? &#39;&amp;#xa0;&#39; : // display for other months</span></div>
<div class="line"><a name="l08548"></a><span class="lineno"> 8548</span>&#160;<span class="stringliteral">                            (unselectable ? &#39;&lt;span class=&quot;</span>ui-state-<span class="keywordflow">default</span><span class="stringliteral">&quot;&gt;&#39; + printDate.getDate() + &#39;&lt;/span&gt;&#39; : &#39;&lt;a class=&quot;</span>ui-state-<span class="keywordflow">default</span><span class="stringliteral">&#39; +</span></div>
<div class="line"><a name="l08549"></a><span class="lineno"> 8549</span>&#160;<span class="stringliteral">                            (printDate.getTime() == today.getTime() ? &#39;</span> ui-state-highlight<span class="stringliteral">&#39; : &#39;</span><span class="stringliteral">&#39;) +</span></div>
<div class="line"><a name="l08550"></a><span class="lineno"> 8550</span>&#160;<span class="stringliteral">                            (printDate.getTime() == currentDate.getTime() ? &#39;</span> ui-state-active<span class="stringliteral">&#39; : &#39;</span><span class="stringliteral">&#39;) + // highlight selected day</span></div>
<div class="line"><a name="l08551"></a><span class="lineno"> 8551</span>&#160;<span class="stringliteral">                            (otherMonth ? &#39;</span> ui-priority-secondary<span class="stringliteral">&#39; : &#39;</span><span class="stringliteral">&#39;) + // distinguish dates from other months</span></div>
<div class="line"><a name="l08552"></a><span class="lineno"> 8552</span>&#160;<span class="stringliteral">                            &#39;</span><span class="stringliteral">&quot; href=&quot;</span>#<span class="stringliteral">&quot;&gt;&#39; + printDate.getDate() + &#39;&lt;/a&gt;&#39;)) + &#39;&lt;/td&gt;&#39;; // display selectable date</span></div>
<div class="line"><a name="l08553"></a><span class="lineno"> 8553</span>&#160;<span class="stringliteral">                        printDate.setDate(printDate.getDate() + 1);</span></div>
<div class="line"><a name="l08554"></a><span class="lineno"> 8554</span>&#160;<span class="stringliteral">                        printDate = this._daylightSavingAdjust(printDate);</span></div>
<div class="line"><a name="l08555"></a><span class="lineno"> 8555</span>&#160;<span class="stringliteral">                    }</span></div>
<div class="line"><a name="l08556"></a><span class="lineno"> 8556</span>&#160;<span class="stringliteral">                    calender += tbody + &#39;&lt;/tr&gt;&#39;;</span></div>
<div class="line"><a name="l08557"></a><span class="lineno"> 8557</span>&#160;<span class="stringliteral">                }</span></div>
<div class="line"><a name="l08558"></a><span class="lineno"> 8558</span>&#160;<span class="stringliteral">                drawMonth++;</span></div>
<div class="line"><a name="l08559"></a><span class="lineno"> 8559</span>&#160;<span class="stringliteral">                if (drawMonth &gt; 11) {</span></div>
<div class="line"><a name="l08560"></a><span class="lineno"> 8560</span>&#160;<span class="stringliteral">                    drawMonth = 0;</span></div>
<div class="line"><a name="l08561"></a><span class="lineno"> 8561</span>&#160;<span class="stringliteral">                    drawYear++;</span></div>
<div class="line"><a name="l08562"></a><span class="lineno"> 8562</span>&#160;<span class="stringliteral">                }</span></div>
<div class="line"><a name="l08563"></a><span class="lineno"> 8563</span>&#160;<span class="stringliteral">                calender += &#39;&lt;/tbody&gt;&lt;/table&gt;&#39; + (isMultiMonth ? &#39;&lt;/div&gt;&#39; + </span></div>
<div class="line"><a name="l08564"></a><span class="lineno"> 8564</span>&#160;<span class="stringliteral">                            ((numMonths[0] &gt; 0 &amp;&amp; col == numMonths[1]-1) ? &#39;&lt;div class=&quot;</span>ui-datepicker-row-<span class="keywordflow">break</span><span class="stringliteral">&quot;&gt;&lt;/div&gt;&#39; : &#39;&#39;) : &#39;&#39;);</span></div>
<div class="line"><a name="l08565"></a><span class="lineno"> 8565</span>&#160;<span class="stringliteral">                group += calender;</span></div>
<div class="line"><a name="l08566"></a><span class="lineno"> 8566</span>&#160;<span class="stringliteral">            }</span></div>
<div class="line"><a name="l08567"></a><span class="lineno"> 8567</span>&#160;<span class="stringliteral">            html += group;</span></div>
<div class="line"><a name="l08568"></a><span class="lineno"> 8568</span>&#160;<span class="stringliteral">        }</span></div>
<div class="line"><a name="l08569"></a><span class="lineno"> 8569</span>&#160;<span class="stringliteral">        html += buttonPanel + ($.browser.msie &amp;&amp; parseInt($.browser.version,10) &lt; 7 &amp;&amp; !inst.inline ?</span></div>
<div class="line"><a name="l08570"></a><span class="lineno"> 8570</span>&#160;<span class="stringliteral">            &#39;&lt;iframe src=&quot;</span>javascript:<span class="keyword">false</span>;<span class="stringliteral">&quot; class=&quot;</span>ui-datepicker-cover<span class="stringliteral">&quot; frameborder=&quot;</span>0<span class="stringliteral">&quot;&gt;&lt;/iframe&gt;&#39; : &#39;&#39;);</span></div>
<div class="line"><a name="l08571"></a><span class="lineno"> 8571</span>&#160;<span class="stringliteral">        inst._keyEvent = false;</span></div>
<div class="line"><a name="l08572"></a><span class="lineno"> 8572</span>&#160;<span class="stringliteral">        return html;</span></div>
<div class="line"><a name="l08573"></a><span class="lineno"> 8573</span>&#160;<span class="stringliteral">    },</span></div>
<div class="line"><a name="l08574"></a><span class="lineno"> 8574</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l08575"></a><span class="lineno"> 8575</span>&#160;<span class="stringliteral">    /* Generate the month and year header. */</span></div>
<div class="line"><a name="l08576"></a><span class="lineno"> 8576</span>&#160;<span class="stringliteral">    _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,</span></div>
<div class="line"><a name="l08577"></a><span class="lineno"> 8577</span>&#160;<span class="stringliteral">            secondary, monthNames, monthNamesShort) {</span></div>
<div class="line"><a name="l08578"></a><span class="lineno"> 8578</span>&#160;<span class="stringliteral">        var changeMonth = this._get(inst, &#39;changeMonth&#39;);</span></div>
<div class="line"><a name="l08579"></a><span class="lineno"> 8579</span>&#160;<span class="stringliteral">        var changeYear = this._get(inst, &#39;changeYear&#39;);</span></div>
<div class="line"><a name="l08580"></a><span class="lineno"> 8580</span>&#160;<span class="stringliteral">        var showMonthAfterYear = this._get(inst, &#39;showMonthAfterYear&#39;);</span></div>
<div class="line"><a name="l08581"></a><span class="lineno"> 8581</span>&#160;<span class="stringliteral">        var html = &#39;&lt;div class=&quot;</span>ui-datepicker-title<span class="stringliteral">&quot;&gt;&#39;;</span></div>
<div class="line"><a name="l08582"></a><span class="lineno"> 8582</span>&#160;<span class="stringliteral">        var monthHtml = &#39;&#39;;</span></div>
<div class="line"><a name="l08583"></a><span class="lineno"> 8583</span>&#160;<span class="stringliteral">        // month selection</span></div>
<div class="line"><a name="l08584"></a><span class="lineno"> 8584</span>&#160;<span class="stringliteral">        if (secondary || !changeMonth)</span></div>
<div class="line"><a name="l08585"></a><span class="lineno"> 8585</span>&#160;<span class="stringliteral">            monthHtml += &#39;&lt;span class=&quot;</span>ui-datepicker-month<span class="stringliteral">&quot;&gt;&#39; + monthNames[drawMonth] + &#39;&lt;/span&gt;&#39;;</span></div>
<div class="line"><a name="l08586"></a><span class="lineno"> 8586</span>&#160;<span class="stringliteral">        else {</span></div>
<div class="line"><a name="l08587"></a><span class="lineno"> 8587</span>&#160;<span class="stringliteral">            var inMinYear = (minDate &amp;&amp; minDate.getFullYear() == drawYear);</span></div>
<div class="line"><a name="l08588"></a><span class="lineno"> 8588</span>&#160;<span class="stringliteral">            var inMaxYear = (maxDate &amp;&amp; maxDate.getFullYear() == drawYear);</span></div>
<div class="line"><a name="l08589"></a><span class="lineno"> 8589</span>&#160;<span class="stringliteral">            monthHtml += &#39;&lt;select class=&quot;</span>ui-datepicker-month<span class="stringliteral">&quot; &#39; +</span></div>
<div class="line"><a name="l08590"></a><span class="lineno"> 8590</span>&#160;<span class="stringliteral">                &#39;onchange=&quot;</span>DP_jQuery_<span class="stringliteral">&#39; + dpuuid + &#39;</span>.datepicker._selectMonthYear(\<span class="charliteral">&#39;#&#39;</span> + inst.id + <span class="charliteral">&#39;\&#39;</span>, <span class="keyword">this</span>, \<span class="stringliteral">&#39;M\&#39;);&quot; &#39;</span> +</div>
<div class="line"><a name="l08591"></a><span class="lineno"> 8591</span>&#160;                <span class="charliteral">&#39;&gt;&#39;</span>;</div>
<div class="line"><a name="l08592"></a><span class="lineno"> 8592</span>&#160;            for (var month = 0; month &lt; 12; month++) {</div>
<div class="line"><a name="l08593"></a><span class="lineno"> 8593</span>&#160;                <span class="keywordflow">if</span> ((!inMinYear || month &gt;= minDate.getMonth()) &amp;&amp;</div>
<div class="line"><a name="l08594"></a><span class="lineno"> 8594</span>&#160;                        (!inMaxYear || month &lt;= maxDate.getMonth()))</div>
<div class="line"><a name="l08595"></a><span class="lineno"> 8595</span>&#160;                    monthHtml += <span class="stringliteral">&#39;&lt;option value=&quot;&#39;</span> + month + <span class="charliteral">&#39;&quot;&#39;</span> +</div>
<div class="line"><a name="l08596"></a><span class="lineno"> 8596</span>&#160;                        (month == drawMonth ? <span class="stringliteral">&#39; selected=&quot;selected&quot;&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) +</div>
<div class="line"><a name="l08597"></a><span class="lineno"> 8597</span>&#160;                        <span class="charliteral">&#39;&gt;&#39;</span> + monthNamesShort[month] + <span class="stringliteral">&#39;&lt;/option&gt;&#39;</span>;</div>
<div class="line"><a name="l08598"></a><span class="lineno"> 8598</span>&#160;            }</div>
<div class="line"><a name="l08599"></a><span class="lineno"> 8599</span>&#160;            monthHtml += <span class="stringliteral">&#39;&lt;/select&gt;&#39;</span>;</div>
<div class="line"><a name="l08600"></a><span class="lineno"> 8600</span>&#160;        }</div>
<div class="line"><a name="l08601"></a><span class="lineno"> 8601</span>&#160;        <span class="keywordflow">if</span> (!showMonthAfterYear)</div>
<div class="line"><a name="l08602"></a><span class="lineno"> 8602</span>&#160;            html += monthHtml + (secondary || !(changeMonth &amp;&amp; changeYear) ? <span class="stringliteral">&#39;&amp;#xa0;&#39;</span> : <span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l08603"></a><span class="lineno"> 8603</span>&#160;        <span class="comment">// year selection</span></div>
<div class="line"><a name="l08604"></a><span class="lineno"> 8604</span>&#160;        <span class="keywordflow">if</span> ( !inst.yearshtml ) {</div>
<div class="line"><a name="l08605"></a><span class="lineno"> 8605</span>&#160;            inst.yearshtml = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l08606"></a><span class="lineno"> 8606</span>&#160;            <span class="keywordflow">if</span> (secondary || !changeYear)</div>
<div class="line"><a name="l08607"></a><span class="lineno"> 8607</span>&#160;                html += <span class="stringliteral">&#39;&lt;span class=&quot;ui-datepicker-year&quot;&gt;&#39;</span> + drawYear + <span class="stringliteral">&#39;&lt;/span&gt;&#39;</span>;</div>
<div class="line"><a name="l08608"></a><span class="lineno"> 8608</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l08609"></a><span class="lineno"> 8609</span>&#160;                <span class="comment">// determine range of years to display</span></div>
<div class="line"><a name="l08610"></a><span class="lineno"> 8610</span>&#160;                var years = this._get(inst, <span class="stringliteral">&#39;yearRange&#39;</span>).split(<span class="charliteral">&#39;:&#39;</span>);</div>
<div class="line"><a name="l08611"></a><span class="lineno"> 8611</span>&#160;                var thisYear = <span class="keyword">new</span> Date().getFullYear();</div>
<div class="line"><a name="l08612"></a><span class="lineno"> 8612</span>&#160;                var determineYear = <span class="keyword">function</span>(value) {</div>
<div class="line"><a name="l08613"></a><span class="lineno"> 8613</span>&#160;                    var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :</div>
<div class="line"><a name="l08614"></a><span class="lineno"> 8614</span>&#160;                        (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :</div>
<div class="line"><a name="l08615"></a><span class="lineno"> 8615</span>&#160;                        parseInt(value, 10)));</div>
<div class="line"><a name="l08616"></a><span class="lineno"> 8616</span>&#160;                    <span class="keywordflow">return</span> (isNaN(year) ? thisYear : year);</div>
<div class="line"><a name="l08617"></a><span class="lineno"> 8617</span>&#160;                };</div>
<div class="line"><a name="l08618"></a><span class="lineno"> 8618</span>&#160;                var year = determineYear(years[0]);</div>
<div class="line"><a name="l08619"></a><span class="lineno"> 8619</span>&#160;                var endYear = Math.max(year, determineYear(years[1] || <span class="stringliteral">&#39;&#39;</span>));</div>
<div class="line"><a name="l08620"></a><span class="lineno"> 8620</span>&#160;                year = (minDate ? Math.max(year, minDate.getFullYear()) : year);</div>
<div class="line"><a name="l08621"></a><span class="lineno"> 8621</span>&#160;                endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);</div>
<div class="line"><a name="l08622"></a><span class="lineno"> 8622</span>&#160;                inst.yearshtml += <span class="stringliteral">&#39;&lt;select class=&quot;ui-datepicker-year&quot; &#39;</span> +</div>
<div class="line"><a name="l08623"></a><span class="lineno"> 8623</span>&#160;                    <span class="stringliteral">&#39;onchange=&quot;DP_jQuery_&#39;</span> + dpuuid + <span class="stringliteral">&#39;.datepicker._selectMonthYear(\&#39;#&#39;</span> + inst.id + <span class="charliteral">&#39;\&#39;</span>, <span class="keyword">this</span>, \<span class="stringliteral">&#39;Y\&#39;);&quot; &#39;</span> +</div>
<div class="line"><a name="l08624"></a><span class="lineno"> 8624</span>&#160;                    <span class="charliteral">&#39;&gt;&#39;</span>;</div>
<div class="line"><a name="l08625"></a><span class="lineno"> 8625</span>&#160;                <span class="keywordflow">for</span> (; year &lt;= endYear; year++) {</div>
<div class="line"><a name="l08626"></a><span class="lineno"> 8626</span>&#160;                    inst.yearshtml += <span class="stringliteral">&#39;&lt;option value=&quot;&#39;</span> + year + <span class="charliteral">&#39;&quot;&#39;</span> +</div>
<div class="line"><a name="l08627"></a><span class="lineno"> 8627</span>&#160;                        (year == drawYear ? <span class="stringliteral">&#39; selected=&quot;selected&quot;&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) +</div>
<div class="line"><a name="l08628"></a><span class="lineno"> 8628</span>&#160;                        <span class="charliteral">&#39;&gt;&#39;</span> + year + <span class="stringliteral">&#39;&lt;/option&gt;&#39;</span>;</div>
<div class="line"><a name="l08629"></a><span class="lineno"> 8629</span>&#160;                }</div>
<div class="line"><a name="l08630"></a><span class="lineno"> 8630</span>&#160;                inst.yearshtml += <span class="stringliteral">&#39;&lt;/select&gt;&#39;</span>;</div>
<div class="line"><a name="l08631"></a><span class="lineno"> 8631</span>&#160;                </div>
<div class="line"><a name="l08632"></a><span class="lineno"> 8632</span>&#160;                html += inst.yearshtml;</div>
<div class="line"><a name="l08633"></a><span class="lineno"> 8633</span>&#160;                inst.yearshtml = null;</div>
<div class="line"><a name="l08634"></a><span class="lineno"> 8634</span>&#160;            }</div>
<div class="line"><a name="l08635"></a><span class="lineno"> 8635</span>&#160;        }</div>
<div class="line"><a name="l08636"></a><span class="lineno"> 8636</span>&#160;        html += this._get(inst, <span class="stringliteral">&#39;yearSuffix&#39;</span>);</div>
<div class="line"><a name="l08637"></a><span class="lineno"> 8637</span>&#160;        <span class="keywordflow">if</span> (showMonthAfterYear)</div>
<div class="line"><a name="l08638"></a><span class="lineno"> 8638</span>&#160;            html += (secondary || !(changeMonth &amp;&amp; changeYear) ? <span class="stringliteral">&#39;&amp;#xa0;&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) + monthHtml;</div>
<div class="line"><a name="l08639"></a><span class="lineno"> 8639</span>&#160;        html += <span class="stringliteral">&#39;&lt;/div&gt;&#39;</span>; <span class="comment">// Close datepicker_header</span></div>
<div class="line"><a name="l08640"></a><span class="lineno"> 8640</span>&#160;        <span class="keywordflow">return</span> html;</div>
<div class="line"><a name="l08641"></a><span class="lineno"> 8641</span>&#160;    },</div>
<div class="line"><a name="l08642"></a><span class="lineno"> 8642</span>&#160;</div>
<div class="line"><a name="l08643"></a><span class="lineno"> 8643</span>&#160;    <span class="comment">/* Adjust one of the date sub-fields. */</span></div>
<div class="line"><a name="l08644"></a><span class="lineno"> 8644</span>&#160;    _adjustInstDate: <span class="keyword">function</span>(inst, offset, period) {</div>
<div class="line"><a name="l08645"></a><span class="lineno"> 8645</span>&#160;        var year = inst.drawYear + (period == <span class="charliteral">&#39;Y&#39;</span> ? offset : 0);</div>
<div class="line"><a name="l08646"></a><span class="lineno"> 8646</span>&#160;        var month = inst.drawMonth + (period == <span class="charliteral">&#39;M&#39;</span> ? offset : 0);</div>
<div class="line"><a name="l08647"></a><span class="lineno"> 8647</span>&#160;        var day = Math.min(inst.selectedDay, <span class="keyword">this</span>._getDaysInMonth(year, month)) +</div>
<div class="line"><a name="l08648"></a><span class="lineno"> 8648</span>&#160;            (period == <span class="charliteral">&#39;D&#39;</span> ? offset : 0);</div>
<div class="line"><a name="l08649"></a><span class="lineno"> 8649</span>&#160;        var date = this._restrictMinMax(inst,</div>
<div class="line"><a name="l08650"></a><span class="lineno"> 8650</span>&#160;            this._daylightSavingAdjust(<span class="keyword">new</span> Date(year, month, day)));</div>
<div class="line"><a name="l08651"></a><span class="lineno"> 8651</span>&#160;        inst.selectedDay = date.getDate();</div>
<div class="line"><a name="l08652"></a><span class="lineno"> 8652</span>&#160;        inst.drawMonth = inst.selectedMonth = date.getMonth();</div>
<div class="line"><a name="l08653"></a><span class="lineno"> 8653</span>&#160;        inst.drawYear = inst.selectedYear = date.getFullYear();</div>
<div class="line"><a name="l08654"></a><span class="lineno"> 8654</span>&#160;        <span class="keywordflow">if</span> (period == <span class="charliteral">&#39;M&#39;</span> || period == <span class="charliteral">&#39;Y&#39;</span>)</div>
<div class="line"><a name="l08655"></a><span class="lineno"> 8655</span>&#160;            this._notifyChange(inst);</div>
<div class="line"><a name="l08656"></a><span class="lineno"> 8656</span>&#160;    },</div>
<div class="line"><a name="l08657"></a><span class="lineno"> 8657</span>&#160;</div>
<div class="line"><a name="l08658"></a><span class="lineno"> 8658</span>&#160;    <span class="comment">/* Ensure a date is within any min/max bounds. */</span></div>
<div class="line"><a name="l08659"></a><span class="lineno"> 8659</span>&#160;    _restrictMinMax: <span class="keyword">function</span>(inst, date) {</div>
<div class="line"><a name="l08660"></a><span class="lineno"> 8660</span>&#160;        var minDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;min&#39;</span>);</div>
<div class="line"><a name="l08661"></a><span class="lineno"> 8661</span>&#160;        var maxDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;max&#39;</span>);</div>
<div class="line"><a name="l08662"></a><span class="lineno"> 8662</span>&#160;        var newDate = (minDate &amp;&amp; date &lt; minDate ? minDate : date);</div>
<div class="line"><a name="l08663"></a><span class="lineno"> 8663</span>&#160;        newDate = (maxDate &amp;&amp; newDate &gt; maxDate ? maxDate : newDate);</div>
<div class="line"><a name="l08664"></a><span class="lineno"> 8664</span>&#160;        <span class="keywordflow">return</span> newDate;</div>
<div class="line"><a name="l08665"></a><span class="lineno"> 8665</span>&#160;    },</div>
<div class="line"><a name="l08666"></a><span class="lineno"> 8666</span>&#160;</div>
<div class="line"><a name="l08667"></a><span class="lineno"> 8667</span>&#160;    <span class="comment">/* Notify change of month/year. */</span></div>
<div class="line"><a name="l08668"></a><span class="lineno"> 8668</span>&#160;    _notifyChange: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l08669"></a><span class="lineno"> 8669</span>&#160;        var onChange = this._get(inst, <span class="stringliteral">&#39;onChangeMonthYear&#39;</span>);</div>
<div class="line"><a name="l08670"></a><span class="lineno"> 8670</span>&#160;        <span class="keywordflow">if</span> (onChange)</div>
<div class="line"><a name="l08671"></a><span class="lineno"> 8671</span>&#160;            onChange.apply((inst.input ? inst.input[0] : null),</div>
<div class="line"><a name="l08672"></a><span class="lineno"> 8672</span>&#160;                [inst.selectedYear, inst.selectedMonth + 1, inst]);</div>
<div class="line"><a name="l08673"></a><span class="lineno"> 8673</span>&#160;    },</div>
<div class="line"><a name="l08674"></a><span class="lineno"> 8674</span>&#160;</div>
<div class="line"><a name="l08675"></a><span class="lineno"> 8675</span>&#160;    <span class="comment">/* Determine the number of months to show. */</span></div>
<div class="line"><a name="l08676"></a><span class="lineno"> 8676</span>&#160;    _getNumberOfMonths: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l08677"></a><span class="lineno"> 8677</span>&#160;        var numMonths = this._get(inst, <span class="stringliteral">&#39;numberOfMonths&#39;</span>);</div>
<div class="line"><a name="l08678"></a><span class="lineno"> 8678</span>&#160;        <span class="keywordflow">return</span> (numMonths == null ? [1, 1] : (typeof numMonths == <span class="stringliteral">&#39;number&#39;</span> ? [1, numMonths] : numMonths));</div>
<div class="line"><a name="l08679"></a><span class="lineno"> 8679</span>&#160;    },</div>
<div class="line"><a name="l08680"></a><span class="lineno"> 8680</span>&#160;</div>
<div class="line"><a name="l08681"></a><span class="lineno"> 8681</span>&#160;    <span class="comment">/* Determine the current maximum date - ensure no time components are set. */</span></div>
<div class="line"><a name="l08682"></a><span class="lineno"> 8682</span>&#160;    _getMinMaxDate: <span class="keyword">function</span>(inst, minMax) {</div>
<div class="line"><a name="l08683"></a><span class="lineno"> 8683</span>&#160;        <span class="keywordflow">return</span> this._determineDate(inst, this._get(inst, minMax + <span class="stringliteral">&#39;Date&#39;</span>), null);</div>
<div class="line"><a name="l08684"></a><span class="lineno"> 8684</span>&#160;    },</div>
<div class="line"><a name="l08685"></a><span class="lineno"> 8685</span>&#160;</div>
<div class="line"><a name="l08686"></a><span class="lineno"> 8686</span>&#160;    <span class="comment">/* Find the number of days in a given month. */</span></div>
<div class="line"><a name="l08687"></a><span class="lineno"> 8687</span>&#160;    _getDaysInMonth: <span class="keyword">function</span>(year, month) {</div>
<div class="line"><a name="l08688"></a><span class="lineno"> 8688</span>&#160;        <span class="keywordflow">return</span> 32 - this._daylightSavingAdjust(<span class="keyword">new</span> Date(year, month, 32)).getDate();</div>
<div class="line"><a name="l08689"></a><span class="lineno"> 8689</span>&#160;    },</div>
<div class="line"><a name="l08690"></a><span class="lineno"> 8690</span>&#160;</div>
<div class="line"><a name="l08691"></a><span class="lineno"> 8691</span>&#160;    <span class="comment">/* Find the day of the week of the first of a month. */</span></div>
<div class="line"><a name="l08692"></a><span class="lineno"> 8692</span>&#160;    _getFirstDayOfMonth: <span class="keyword">function</span>(year, month) {</div>
<div class="line"><a name="l08693"></a><span class="lineno"> 8693</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">new</span> Date(year, month, 1).getDay();</div>
<div class="line"><a name="l08694"></a><span class="lineno"> 8694</span>&#160;    },</div>
<div class="line"><a name="l08695"></a><span class="lineno"> 8695</span>&#160;</div>
<div class="line"><a name="l08696"></a><span class="lineno"> 8696</span>&#160;    <span class="comment">/* Determines if we should allow a &quot;next/prev&quot; month display change. */</span></div>
<div class="line"><a name="l08697"></a><span class="lineno"> 8697</span>&#160;    _canAdjustMonth: <span class="keyword">function</span>(inst, offset, curYear, curMonth) {</div>
<div class="line"><a name="l08698"></a><span class="lineno"> 8698</span>&#160;        var numMonths = this._getNumberOfMonths(inst);</div>
<div class="line"><a name="l08699"></a><span class="lineno"> 8699</span>&#160;        var date = this._daylightSavingAdjust(<span class="keyword">new</span> Date(curYear,</div>
<div class="line"><a name="l08700"></a><span class="lineno"> 8700</span>&#160;            curMonth + (offset &lt; 0 ? offset : numMonths[0] * numMonths[1]), 1));</div>
<div class="line"><a name="l08701"></a><span class="lineno"> 8701</span>&#160;        <span class="keywordflow">if</span> (offset &lt; 0)</div>
<div class="line"><a name="l08702"></a><span class="lineno"> 8702</span>&#160;            date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));</div>
<div class="line"><a name="l08703"></a><span class="lineno"> 8703</span>&#160;        <span class="keywordflow">return</span> this._isInRange(inst, date);</div>
<div class="line"><a name="l08704"></a><span class="lineno"> 8704</span>&#160;    },</div>
<div class="line"><a name="l08705"></a><span class="lineno"> 8705</span>&#160;</div>
<div class="line"><a name="l08706"></a><span class="lineno"> 8706</span>&#160;    <span class="comment">/* Is the given date in the accepted range? */</span></div>
<div class="line"><a name="l08707"></a><span class="lineno"> 8707</span>&#160;    _isInRange: <span class="keyword">function</span>(inst, date) {</div>
<div class="line"><a name="l08708"></a><span class="lineno"> 8708</span>&#160;        var minDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;min&#39;</span>);</div>
<div class="line"><a name="l08709"></a><span class="lineno"> 8709</span>&#160;        var maxDate = this._getMinMaxDate(inst, <span class="stringliteral">&#39;max&#39;</span>);</div>
<div class="line"><a name="l08710"></a><span class="lineno"> 8710</span>&#160;        <span class="keywordflow">return</span> ((!minDate || date.getTime() &gt;= minDate.getTime()) &amp;&amp;</div>
<div class="line"><a name="l08711"></a><span class="lineno"> 8711</span>&#160;            (!maxDate || date.getTime() &lt;= maxDate.getTime()));</div>
<div class="line"><a name="l08712"></a><span class="lineno"> 8712</span>&#160;    },</div>
<div class="line"><a name="l08713"></a><span class="lineno"> 8713</span>&#160;</div>
<div class="line"><a name="l08714"></a><span class="lineno"> 8714</span>&#160;    <span class="comment">/* Provide the configuration settings for formatting/parsing. */</span></div>
<div class="line"><a name="l08715"></a><span class="lineno"> 8715</span>&#160;    _getFormatConfig: <span class="keyword">function</span>(inst) {</div>
<div class="line"><a name="l08716"></a><span class="lineno"> 8716</span>&#160;        var shortYearCutoff = this._get(inst, <span class="stringliteral">&#39;shortYearCutoff&#39;</span>);</div>
<div class="line"><a name="l08717"></a><span class="lineno"> 8717</span>&#160;        shortYearCutoff = (typeof shortYearCutoff != <span class="stringliteral">&#39;string&#39;</span> ? shortYearCutoff :</div>
<div class="line"><a name="l08718"></a><span class="lineno"> 8718</span>&#160;            <span class="keyword">new</span> Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));</div>
<div class="line"><a name="l08719"></a><span class="lineno"> 8719</span>&#160;        <span class="keywordflow">return</span> {shortYearCutoff: shortYearCutoff,</div>
<div class="line"><a name="l08720"></a><span class="lineno"> 8720</span>&#160;            dayNamesShort: this._get(inst, <span class="stringliteral">&#39;dayNamesShort&#39;</span>), dayNames: this._get(inst, <span class="stringliteral">&#39;dayNames&#39;</span>),</div>
<div class="line"><a name="l08721"></a><span class="lineno"> 8721</span>&#160;            monthNamesShort: this._get(inst, <span class="stringliteral">&#39;monthNamesShort&#39;</span>), monthNames: this._get(inst, <span class="stringliteral">&#39;monthNames&#39;</span>)};</div>
<div class="line"><a name="l08722"></a><span class="lineno"> 8722</span>&#160;    },</div>
<div class="line"><a name="l08723"></a><span class="lineno"> 8723</span>&#160;</div>
<div class="line"><a name="l08724"></a><span class="lineno"> 8724</span>&#160;    <span class="comment">/* Format the given date for display. */</span></div>
<div class="line"><a name="l08725"></a><span class="lineno"> 8725</span>&#160;    _formatDate: <span class="keyword">function</span>(inst, day, month, year) {</div>
<div class="line"><a name="l08726"></a><span class="lineno"> 8726</span>&#160;        <span class="keywordflow">if</span> (!day) {</div>
<div class="line"><a name="l08727"></a><span class="lineno"> 8727</span>&#160;            inst.currentDay = inst.selectedDay;</div>
<div class="line"><a name="l08728"></a><span class="lineno"> 8728</span>&#160;            inst.currentMonth = inst.selectedMonth;</div>
<div class="line"><a name="l08729"></a><span class="lineno"> 8729</span>&#160;            inst.currentYear = inst.selectedYear;</div>
<div class="line"><a name="l08730"></a><span class="lineno"> 8730</span>&#160;        }</div>
<div class="line"><a name="l08731"></a><span class="lineno"> 8731</span>&#160;        var date = (day ? (typeof day == <span class="stringliteral">&#39;object&#39;</span> ? day :</div>
<div class="line"><a name="l08732"></a><span class="lineno"> 8732</span>&#160;            this._daylightSavingAdjust(<span class="keyword">new</span> Date(year, month, day))) :</div>
<div class="line"><a name="l08733"></a><span class="lineno"> 8733</span>&#160;            this._daylightSavingAdjust(<span class="keyword">new</span> Date(inst.currentYear, inst.currentMonth, inst.currentDay)));</div>
<div class="line"><a name="l08734"></a><span class="lineno"> 8734</span>&#160;        <span class="keywordflow">return</span> this.formatDate(this._get(inst, <span class="stringliteral">&#39;dateFormat&#39;</span>), date, this._getFormatConfig(inst));</div>
<div class="line"><a name="l08735"></a><span class="lineno"> 8735</span>&#160;    }</div>
<div class="line"><a name="l08736"></a><span class="lineno"> 8736</span>&#160;});</div>
<div class="line"><a name="l08737"></a><span class="lineno"> 8737</span>&#160;</div>
<div class="line"><a name="l08738"></a><span class="lineno"> 8738</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l08739"></a><span class="lineno"> 8739</span>&#160;<span class="comment"> * Bind hover events for datepicker elements.</span></div>
<div class="line"><a name="l08740"></a><span class="lineno"> 8740</span>&#160;<span class="comment"> * Done via delegate so the binding only occurs once in the lifetime of the parent div.</span></div>
<div class="line"><a name="l08741"></a><span class="lineno"> 8741</span>&#160;<span class="comment"> * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.</span></div>
<div class="line"><a name="l08742"></a><span class="lineno"> 8742</span>&#160;<span class="comment"> */</span> </div>
<div class="line"><a name="l08743"></a><span class="lineno"> 8743</span>&#160;<span class="keyword">function</span> bindHover(dpDiv) {</div>
<div class="line"><a name="l08744"></a><span class="lineno"> 8744</span>&#160;    var selector = <span class="stringliteral">&#39;button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a&#39;</span>;</div>
<div class="line"><a name="l08745"></a><span class="lineno"> 8745</span>&#160;    <span class="keywordflow">return</span> dpDiv.bind(<span class="stringliteral">&#39;mouseout&#39;</span>, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l08746"></a><span class="lineno"> 8746</span>&#160;            var elem = $( <span class="keyword">event</span>.target ).closest( selector );</div>
<div class="line"><a name="l08747"></a><span class="lineno"> 8747</span>&#160;            <span class="keywordflow">if</span> ( !elem.length ) {</div>
<div class="line"><a name="l08748"></a><span class="lineno"> 8748</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l08749"></a><span class="lineno"> 8749</span>&#160;            }</div>
<div class="line"><a name="l08750"></a><span class="lineno"> 8750</span>&#160;            elem.removeClass( <span class="stringliteral">&quot;ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover&quot;</span> );</div>
<div class="line"><a name="l08751"></a><span class="lineno"> 8751</span>&#160;        })</div>
<div class="line"><a name="l08752"></a><span class="lineno"> 8752</span>&#160;        .bind(<span class="stringliteral">&#39;mouseover&#39;</span>, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l08753"></a><span class="lineno"> 8753</span>&#160;            var elem = $( <span class="keyword">event</span>.target ).closest( selector );</div>
<div class="line"><a name="l08754"></a><span class="lineno"> 8754</span>&#160;            <span class="keywordflow">if</span> ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) ||</div>
<div class="line"><a name="l08755"></a><span class="lineno"> 8755</span>&#160;                    !elem.length ) {</div>
<div class="line"><a name="l08756"></a><span class="lineno"> 8756</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l08757"></a><span class="lineno"> 8757</span>&#160;            }</div>
<div class="line"><a name="l08758"></a><span class="lineno"> 8758</span>&#160;            elem.parents(<span class="stringliteral">&#39;.ui-datepicker-calendar&#39;</span>).find(<span class="charliteral">&#39;a&#39;</span>).removeClass(<span class="stringliteral">&#39;ui-state-hover&#39;</span>);</div>
<div class="line"><a name="l08759"></a><span class="lineno"> 8759</span>&#160;            elem.addClass(<span class="stringliteral">&#39;ui-state-hover&#39;</span>);</div>
<div class="line"><a name="l08760"></a><span class="lineno"> 8760</span>&#160;            <span class="keywordflow">if</span> (elem.hasClass(<span class="stringliteral">&#39;ui-datepicker-prev&#39;</span>)) elem.addClass(<span class="stringliteral">&#39;ui-datepicker-prev-hover&#39;</span>);</div>
<div class="line"><a name="l08761"></a><span class="lineno"> 8761</span>&#160;            <span class="keywordflow">if</span> (elem.hasClass(<span class="stringliteral">&#39;ui-datepicker-next&#39;</span>)) elem.addClass(<span class="stringliteral">&#39;ui-datepicker-next-hover&#39;</span>);</div>
<div class="line"><a name="l08762"></a><span class="lineno"> 8762</span>&#160;        });</div>
<div class="line"><a name="l08763"></a><span class="lineno"> 8763</span>&#160;}</div>
<div class="line"><a name="l08764"></a><span class="lineno"> 8764</span>&#160;</div>
<div class="line"><a name="l08765"></a><span class="lineno"> 8765</span>&#160;<span class="comment">/* jQuery extend now ignores nulls! */</span></div>
<div class="line"><a name="l08766"></a><span class="lineno"> 8766</span>&#160;<span class="keyword">function</span> extendRemove(target, props) {</div>
<div class="line"><a name="l08767"></a><span class="lineno"> 8767</span>&#160;    $.extend(target, props);</div>
<div class="line"><a name="l08768"></a><span class="lineno"> 8768</span>&#160;    <span class="keywordflow">for</span> (var name in props)</div>
<div class="line"><a name="l08769"></a><span class="lineno"> 8769</span>&#160;        <span class="keywordflow">if</span> (props[name] == null || props[name] == undefined)</div>
<div class="line"><a name="l08770"></a><span class="lineno"> 8770</span>&#160;            target[name] = props[name];</div>
<div class="line"><a name="l08771"></a><span class="lineno"> 8771</span>&#160;    <span class="keywordflow">return</span> target;</div>
<div class="line"><a name="l08772"></a><span class="lineno"> 8772</span>&#160;};</div>
<div class="line"><a name="l08773"></a><span class="lineno"> 8773</span>&#160;</div>
<div class="line"><a name="l08774"></a><span class="lineno"> 8774</span>&#160;<span class="comment">/* Determine whether an object is an array. */</span></div>
<div class="line"><a name="l08775"></a><span class="lineno"> 8775</span>&#160;<span class="keyword">function</span> isArray(a) {</div>
<div class="line"><a name="l08776"></a><span class="lineno"> 8776</span>&#160;    <span class="keywordflow">return</span> (a &amp;&amp; (($.browser.safari &amp;&amp; typeof a == <span class="stringliteral">&#39;object&#39;</span> &amp;&amp; a.length) ||</div>
<div class="line"><a name="l08777"></a><span class="lineno"> 8777</span>&#160;        (a.constructor &amp;&amp; a.constructor.toString().match(/\Array\(\)/))));</div>
<div class="line"><a name="l08778"></a><span class="lineno"> 8778</span>&#160;};</div>
<div class="line"><a name="l08779"></a><span class="lineno"> 8779</span>&#160;</div>
<div class="line"><a name="l08780"></a><span class="lineno"> 8780</span>&#160;<span class="comment">/* Invoke the datepicker functionality.</span></div>
<div class="line"><a name="l08781"></a><span class="lineno"> 8781</span>&#160;<span class="comment">   @param  options  string - a command, optionally followed by additional parameters or</span></div>
<div class="line"><a name="l08782"></a><span class="lineno"> 8782</span>&#160;<span class="comment">                    Object - settings for attaching new datepicker functionality</span></div>
<div class="line"><a name="l08783"></a><span class="lineno"> 8783</span>&#160;<span class="comment">   @return  jQuery object */</span></div>
<div class="line"><a name="l08784"></a><span class="lineno"> 8784</span>&#160;$.fn.datepicker = <span class="keyword">function</span>(options){</div>
<div class="line"><a name="l08785"></a><span class="lineno"> 8785</span>&#160;    </div>
<div class="line"><a name="l08786"></a><span class="lineno"> 8786</span>&#160;    <span class="comment">/* Verify an empty collection wasn&#39;t passed - Fixes #6976 */</span></div>
<div class="line"><a name="l08787"></a><span class="lineno"> 8787</span>&#160;    <span class="keywordflow">if</span> ( !this.length ) {</div>
<div class="line"><a name="l08788"></a><span class="lineno"> 8788</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l08789"></a><span class="lineno"> 8789</span>&#160;    }</div>
<div class="line"><a name="l08790"></a><span class="lineno"> 8790</span>&#160;    </div>
<div class="line"><a name="l08791"></a><span class="lineno"> 8791</span>&#160;    <span class="comment">/* Initialise the date picker. */</span></div>
<div class="line"><a name="l08792"></a><span class="lineno"> 8792</span>&#160;    <span class="keywordflow">if</span> (!$.datepicker.initialized) {</div>
<div class="line"><a name="l08793"></a><span class="lineno"> 8793</span>&#160;        $(document).mousedown($.datepicker._checkExternalClick).</div>
<div class="line"><a name="l08794"></a><span class="lineno"> 8794</span>&#160;            find(<span class="stringliteral">&#39;body&#39;</span>).append($.datepicker.dpDiv);</div>
<div class="line"><a name="l08795"></a><span class="lineno"> 8795</span>&#160;        $.datepicker.initialized = <span class="keyword">true</span>;</div>
<div class="line"><a name="l08796"></a><span class="lineno"> 8796</span>&#160;    }</div>
<div class="line"><a name="l08797"></a><span class="lineno"> 8797</span>&#160;</div>
<div class="line"><a name="l08798"></a><span class="lineno"> 8798</span>&#160;    var otherArgs = Array.prototype.slice.call(arguments, 1);</div>
<div class="line"><a name="l08799"></a><span class="lineno"> 8799</span>&#160;    <span class="keywordflow">if</span> (typeof options == <span class="stringliteral">&#39;string&#39;</span> &amp;&amp; (options == <span class="stringliteral">&#39;isDisabled&#39;</span> || options == <span class="stringliteral">&#39;getDate&#39;</span> || options == <span class="stringliteral">&#39;widget&#39;</span>))</div>
<div class="line"><a name="l08800"></a><span class="lineno"> 8800</span>&#160;        <span class="keywordflow">return</span> $.datepicker[<span class="charliteral">&#39;_&#39;</span> + options + <span class="stringliteral">&#39;Datepicker&#39;</span>].</div>
<div class="line"><a name="l08801"></a><span class="lineno"> 8801</span>&#160;            apply($.datepicker, [<span class="keyword">this</span>[0]].concat(otherArgs));</div>
<div class="line"><a name="l08802"></a><span class="lineno"> 8802</span>&#160;    <span class="keywordflow">if</span> (options == <span class="stringliteral">&#39;option&#39;</span> &amp;&amp; arguments.length == 2 &amp;&amp; typeof arguments[1] == <span class="stringliteral">&#39;string&#39;</span>)</div>
<div class="line"><a name="l08803"></a><span class="lineno"> 8803</span>&#160;        <span class="keywordflow">return</span> $.datepicker[<span class="charliteral">&#39;_&#39;</span> + options + <span class="stringliteral">&#39;Datepicker&#39;</span>].</div>
<div class="line"><a name="l08804"></a><span class="lineno"> 8804</span>&#160;            apply($.datepicker, [<span class="keyword">this</span>[0]].concat(otherArgs));</div>
<div class="line"><a name="l08805"></a><span class="lineno"> 8805</span>&#160;    <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l08806"></a><span class="lineno"> 8806</span>&#160;        typeof options == <span class="stringliteral">&#39;string&#39;</span> ?</div>
<div class="line"><a name="l08807"></a><span class="lineno"> 8807</span>&#160;            $.datepicker[<span class="charliteral">&#39;_&#39;</span> + options + <span class="stringliteral">&#39;Datepicker&#39;</span>].</div>
<div class="line"><a name="l08808"></a><span class="lineno"> 8808</span>&#160;                apply($.datepicker, [<span class="keyword">this</span>].concat(otherArgs)) :</div>
<div class="line"><a name="l08809"></a><span class="lineno"> 8809</span>&#160;            $.datepicker._attachDatepicker(this, options);</div>
<div class="line"><a name="l08810"></a><span class="lineno"> 8810</span>&#160;    });</div>
<div class="line"><a name="l08811"></a><span class="lineno"> 8811</span>&#160;};</div>
<div class="line"><a name="l08812"></a><span class="lineno"> 8812</span>&#160;</div>
<div class="line"><a name="l08813"></a><span class="lineno"> 8813</span>&#160;$.datepicker = <span class="keyword">new</span> Datepicker(); <span class="comment">// singleton instance</span></div>
<div class="line"><a name="l08814"></a><span class="lineno"> 8814</span>&#160;$.datepicker.initialized = <span class="keyword">false</span>;</div>
<div class="line"><a name="l08815"></a><span class="lineno"> 8815</span>&#160;$.datepicker.uuid = <span class="keyword">new</span> Date().getTime();</div>
<div class="line"><a name="l08816"></a><span class="lineno"> 8816</span>&#160;$.datepicker.version = <span class="stringliteral">&quot;1.8.20&quot;</span>;</div>
<div class="line"><a name="l08817"></a><span class="lineno"> 8817</span>&#160;</div>
<div class="line"><a name="l08818"></a><span class="lineno"> 8818</span>&#160;<span class="comment">// Workaround for #4055</span></div>
<div class="line"><a name="l08819"></a><span class="lineno"> 8819</span>&#160;<span class="comment">// Add another global to avoid noConflict issues with inline event handlers</span></div>
<div class="line"><a name="l08820"></a><span class="lineno"> 8820</span>&#160;window[<span class="stringliteral">&#39;DP_jQuery_&#39;</span> + dpuuid] = $;</div>
<div class="line"><a name="l08821"></a><span class="lineno"> 8821</span>&#160;</div>
<div class="line"><a name="l08822"></a><span class="lineno"> 8822</span>&#160;})(jQuery);</div>
<div class="line"><a name="l08823"></a><span class="lineno"> 8823</span>&#160;</div>
<div class="line"><a name="l08824"></a><span class="lineno"> 8824</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l08825"></a><span class="lineno"> 8825</span>&#160;</div>
<div class="line"><a name="l08826"></a><span class="lineno"> 8826</span>&#160;var uiDialogClasses =</div>
<div class="line"><a name="l08827"></a><span class="lineno"> 8827</span>&#160;        <span class="stringliteral">&#39;ui-dialog &#39;</span> +</div>
<div class="line"><a name="l08828"></a><span class="lineno"> 8828</span>&#160;        <span class="stringliteral">&#39;ui-widget &#39;</span> +</div>
<div class="line"><a name="l08829"></a><span class="lineno"> 8829</span>&#160;        <span class="stringliteral">&#39;ui-widget-content &#39;</span> +</div>
<div class="line"><a name="l08830"></a><span class="lineno"> 8830</span>&#160;        <span class="stringliteral">&#39;ui-corner-all &#39;</span>,</div>
<div class="line"><a name="l08831"></a><span class="lineno"> 8831</span>&#160;    sizeRelatedOptions = {</div>
<div class="line"><a name="l08832"></a><span class="lineno"> 8832</span>&#160;        buttons: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08833"></a><span class="lineno"> 8833</span>&#160;        height: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08834"></a><span class="lineno"> 8834</span>&#160;        maxHeight: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08835"></a><span class="lineno"> 8835</span>&#160;        maxWidth: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08836"></a><span class="lineno"> 8836</span>&#160;        minHeight: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08837"></a><span class="lineno"> 8837</span>&#160;        minWidth: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08838"></a><span class="lineno"> 8838</span>&#160;        width: <span class="keyword">true</span></div>
<div class="line"><a name="l08839"></a><span class="lineno"> 8839</span>&#160;    },</div>
<div class="line"><a name="l08840"></a><span class="lineno"> 8840</span>&#160;    resizableRelatedOptions = {</div>
<div class="line"><a name="l08841"></a><span class="lineno"> 8841</span>&#160;        maxHeight: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08842"></a><span class="lineno"> 8842</span>&#160;        maxWidth: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08843"></a><span class="lineno"> 8843</span>&#160;        minHeight: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08844"></a><span class="lineno"> 8844</span>&#160;        minWidth: <span class="keyword">true</span></div>
<div class="line"><a name="l08845"></a><span class="lineno"> 8845</span>&#160;    },</div>
<div class="line"><a name="l08846"></a><span class="lineno"> 8846</span>&#160;    <span class="comment">// support for jQuery 1.3.2 - handle common attrFn methods for dialog</span></div>
<div class="line"><a name="l08847"></a><span class="lineno"> 8847</span>&#160;    attrFn = $.attrFn || {</div>
<div class="line"><a name="l08848"></a><span class="lineno"> 8848</span>&#160;        val: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08849"></a><span class="lineno"> 8849</span>&#160;        css: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08850"></a><span class="lineno"> 8850</span>&#160;        html: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08851"></a><span class="lineno"> 8851</span>&#160;        text: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08852"></a><span class="lineno"> 8852</span>&#160;        data: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08853"></a><span class="lineno"> 8853</span>&#160;        width: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08854"></a><span class="lineno"> 8854</span>&#160;        height: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08855"></a><span class="lineno"> 8855</span>&#160;        offset: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08856"></a><span class="lineno"> 8856</span>&#160;        click: <span class="keyword">true</span></div>
<div class="line"><a name="l08857"></a><span class="lineno"> 8857</span>&#160;    };</div>
<div class="line"><a name="l08858"></a><span class="lineno"> 8858</span>&#160;</div>
<div class="line"><a name="l08859"></a><span class="lineno"> 8859</span>&#160;$.widget(<span class="stringliteral">&quot;ui.dialog&quot;</span>, {</div>
<div class="line"><a name="l08860"></a><span class="lineno"> 8860</span>&#160;    options: {</div>
<div class="line"><a name="l08861"></a><span class="lineno"> 8861</span>&#160;        autoOpen: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08862"></a><span class="lineno"> 8862</span>&#160;        buttons: {},</div>
<div class="line"><a name="l08863"></a><span class="lineno"> 8863</span>&#160;        closeOnEscape: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08864"></a><span class="lineno"> 8864</span>&#160;        closeText: <span class="stringliteral">&#39;close&#39;</span>,</div>
<div class="line"><a name="l08865"></a><span class="lineno"> 8865</span>&#160;        dialogClass: <span class="stringliteral">&#39;&#39;</span>,</div>
<div class="line"><a name="l08866"></a><span class="lineno"> 8866</span>&#160;        draggable: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08867"></a><span class="lineno"> 8867</span>&#160;        hide: null,</div>
<div class="line"><a name="l08868"></a><span class="lineno"> 8868</span>&#160;        height: <span class="stringliteral">&#39;auto&#39;</span>,</div>
<div class="line"><a name="l08869"></a><span class="lineno"> 8869</span>&#160;        maxHeight: <span class="keyword">false</span>,</div>
<div class="line"><a name="l08870"></a><span class="lineno"> 8870</span>&#160;        maxWidth: <span class="keyword">false</span>,</div>
<div class="line"><a name="l08871"></a><span class="lineno"> 8871</span>&#160;        minHeight: 150,</div>
<div class="line"><a name="l08872"></a><span class="lineno"> 8872</span>&#160;        minWidth: 150,</div>
<div class="line"><a name="l08873"></a><span class="lineno"> 8873</span>&#160;        modal: <span class="keyword">false</span>,</div>
<div class="line"><a name="l08874"></a><span class="lineno"> 8874</span>&#160;        position: {</div>
<div class="line"><a name="l08875"></a><span class="lineno"> 8875</span>&#160;            my: <span class="stringliteral">&#39;center&#39;</span>,</div>
<div class="line"><a name="l08876"></a><span class="lineno"> 8876</span>&#160;            at: <span class="stringliteral">&#39;center&#39;</span>,</div>
<div class="line"><a name="l08877"></a><span class="lineno"> 8877</span>&#160;            collision: <span class="stringliteral">&#39;fit&#39;</span>,</div>
<div class="line"><a name="l08878"></a><span class="lineno"> 8878</span>&#160;            <span class="comment">// ensure that the titlebar is never outside the document</span></div>
<div class="line"><a name="l08879"></a><span class="lineno"> 8879</span>&#160;            <span class="keyword">using</span>: <span class="keyword">function</span>(pos) {</div>
<div class="line"><a name="l08880"></a><span class="lineno"> 8880</span>&#160;                var topOffset = $(<span class="keyword">this</span>).css(pos).offset().top;</div>
<div class="line"><a name="l08881"></a><span class="lineno"> 8881</span>&#160;                <span class="keywordflow">if</span> (topOffset &lt; 0) {</div>
<div class="line"><a name="l08882"></a><span class="lineno"> 8882</span>&#160;                    $(<span class="keyword">this</span>).css(<span class="stringliteral">&#39;top&#39;</span>, pos.top - topOffset);</div>
<div class="line"><a name="l08883"></a><span class="lineno"> 8883</span>&#160;                }</div>
<div class="line"><a name="l08884"></a><span class="lineno"> 8884</span>&#160;            }</div>
<div class="line"><a name="l08885"></a><span class="lineno"> 8885</span>&#160;        },</div>
<div class="line"><a name="l08886"></a><span class="lineno"> 8886</span>&#160;        resizable: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08887"></a><span class="lineno"> 8887</span>&#160;        show: null,</div>
<div class="line"><a name="l08888"></a><span class="lineno"> 8888</span>&#160;        stack: <span class="keyword">true</span>,</div>
<div class="line"><a name="l08889"></a><span class="lineno"> 8889</span>&#160;        title: <span class="stringliteral">&#39;&#39;</span>,</div>
<div class="line"><a name="l08890"></a><span class="lineno"> 8890</span>&#160;        width: 300,</div>
<div class="line"><a name="l08891"></a><span class="lineno"> 8891</span>&#160;        zIndex: 1000</div>
<div class="line"><a name="l08892"></a><span class="lineno"> 8892</span>&#160;    },</div>
<div class="line"><a name="l08893"></a><span class="lineno"> 8893</span>&#160;</div>
<div class="line"><a name="l08894"></a><span class="lineno"> 8894</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l08895"></a><span class="lineno"> 8895</span>&#160;        this.originalTitle = this.element.attr(<span class="stringliteral">&#39;title&#39;</span>);</div>
<div class="line"><a name="l08896"></a><span class="lineno"> 8896</span>&#160;        <span class="comment">// #5742 - .attr() might return a DOMElement</span></div>
<div class="line"><a name="l08897"></a><span class="lineno"> 8897</span>&#160;        <span class="keywordflow">if</span> ( typeof this.originalTitle !== <span class="stringliteral">&quot;string&quot;</span> ) {</div>
<div class="line"><a name="l08898"></a><span class="lineno"> 8898</span>&#160;            this.originalTitle = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l08899"></a><span class="lineno"> 8899</span>&#160;        }</div>
<div class="line"><a name="l08900"></a><span class="lineno"> 8900</span>&#160;</div>
<div class="line"><a name="l08901"></a><span class="lineno"> 8901</span>&#160;        this.options.title = this.options.title || this.originalTitle;</div>
<div class="line"><a name="l08902"></a><span class="lineno"> 8902</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l08903"></a><span class="lineno"> 8903</span>&#160;            options = <span class="keyword">self</span>.options,</div>
<div class="line"><a name="l08904"></a><span class="lineno"> 8904</span>&#160;</div>
<div class="line"><a name="l08905"></a><span class="lineno"> 8905</span>&#160;            title = options.title || <span class="stringliteral">&#39;&amp;#160;&#39;</span>,</div>
<div class="line"><a name="l08906"></a><span class="lineno"> 8906</span>&#160;            titleId = $.ui.dialog.getTitleId(<span class="keyword">self</span>.element),</div>
<div class="line"><a name="l08907"></a><span class="lineno"> 8907</span>&#160;</div>
<div class="line"><a name="l08908"></a><span class="lineno"> 8908</span>&#160;            uiDialog = (<span class="keyword">self</span>.uiDialog = $(<span class="stringliteral">&#39;&lt;div&gt;&lt;/div&gt;&#39;</span>))</div>
<div class="line"><a name="l08909"></a><span class="lineno"> 8909</span>&#160;                .appendTo(document.body)</div>
<div class="line"><a name="l08910"></a><span class="lineno"> 8910</span>&#160;                .hide()</div>
<div class="line"><a name="l08911"></a><span class="lineno"> 8911</span>&#160;                .addClass(uiDialogClasses + options.dialogClass)</div>
<div class="line"><a name="l08912"></a><span class="lineno"> 8912</span>&#160;                .css({</div>
<div class="line"><a name="l08913"></a><span class="lineno"> 8913</span>&#160;                    zIndex: options.zIndex</div>
<div class="line"><a name="l08914"></a><span class="lineno"> 8914</span>&#160;                })</div>
<div class="line"><a name="l08915"></a><span class="lineno"> 8915</span>&#160;                <span class="comment">// setting tabIndex makes the div focusable</span></div>
<div class="line"><a name="l08916"></a><span class="lineno"> 8916</span>&#160;                <span class="comment">// setting outline to 0 prevents a border on focus in Mozilla</span></div>
<div class="line"><a name="l08917"></a><span class="lineno"> 8917</span>&#160;                .attr(<span class="stringliteral">&#39;tabIndex&#39;</span>, -1).css(<span class="stringliteral">&#39;outline&#39;</span>, 0).keydown(<span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l08918"></a><span class="lineno"> 8918</span>&#160;                    <span class="keywordflow">if</span> (options.closeOnEscape &amp;&amp; !event.isDefaultPrevented() &amp;&amp; <span class="keyword">event</span>.keyCode &amp;&amp;</div>
<div class="line"><a name="l08919"></a><span class="lineno"> 8919</span>&#160;                        <span class="keyword">event</span>.keyCode === $.ui.keyCode.ESCAPE) {</div>
<div class="line"><a name="l08920"></a><span class="lineno"> 8920</span>&#160;                        </div>
<div class="line"><a name="l08921"></a><span class="lineno"> 8921</span>&#160;                        <span class="keyword">self</span>.close(event);</div>
<div class="line"><a name="l08922"></a><span class="lineno"> 8922</span>&#160;                        <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l08923"></a><span class="lineno"> 8923</span>&#160;                    }</div>
<div class="line"><a name="l08924"></a><span class="lineno"> 8924</span>&#160;                })</div>
<div class="line"><a name="l08925"></a><span class="lineno"> 8925</span>&#160;                .attr({</div>
<div class="line"><a name="l08926"></a><span class="lineno"> 8926</span>&#160;                    role: <span class="stringliteral">&#39;dialog&#39;</span>,</div>
<div class="line"><a name="l08927"></a><span class="lineno"> 8927</span>&#160;                    <span class="stringliteral">&#39;aria-labelledby&#39;</span>: titleId</div>
<div class="line"><a name="l08928"></a><span class="lineno"> 8928</span>&#160;                })</div>
<div class="line"><a name="l08929"></a><span class="lineno"> 8929</span>&#160;                .mousedown(<span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l08930"></a><span class="lineno"> 8930</span>&#160;                    <span class="keyword">self</span>.moveToTop(<span class="keyword">false</span>, event);</div>
<div class="line"><a name="l08931"></a><span class="lineno"> 8931</span>&#160;                }),</div>
<div class="line"><a name="l08932"></a><span class="lineno"> 8932</span>&#160;</div>
<div class="line"><a name="l08933"></a><span class="lineno"> 8933</span>&#160;            uiDialogContent = <span class="keyword">self</span>.element</div>
<div class="line"><a name="l08934"></a><span class="lineno"> 8934</span>&#160;                .show()</div>
<div class="line"><a name="l08935"></a><span class="lineno"> 8935</span>&#160;                .removeAttr(<span class="stringliteral">&#39;title&#39;</span>)</div>
<div class="line"><a name="l08936"></a><span class="lineno"> 8936</span>&#160;                .addClass(</div>
<div class="line"><a name="l08937"></a><span class="lineno"> 8937</span>&#160;                    <span class="stringliteral">&#39;ui-dialog-content &#39;</span> +</div>
<div class="line"><a name="l08938"></a><span class="lineno"> 8938</span>&#160;                    <span class="stringliteral">&#39;ui-widget-content&#39;</span>)</div>
<div class="line"><a name="l08939"></a><span class="lineno"> 8939</span>&#160;                .appendTo(uiDialog),</div>
<div class="line"><a name="l08940"></a><span class="lineno"> 8940</span>&#160;</div>
<div class="line"><a name="l08941"></a><span class="lineno"> 8941</span>&#160;            uiDialogTitlebar = (<span class="keyword">self</span>.uiDialogTitlebar = $(<span class="stringliteral">&#39;&lt;div&gt;&lt;/div&gt;&#39;</span>))</div>
<div class="line"><a name="l08942"></a><span class="lineno"> 8942</span>&#160;                .addClass(</div>
<div class="line"><a name="l08943"></a><span class="lineno"> 8943</span>&#160;                    <span class="stringliteral">&#39;ui-dialog-titlebar &#39;</span> +</div>
<div class="line"><a name="l08944"></a><span class="lineno"> 8944</span>&#160;                    <span class="stringliteral">&#39;ui-widget-header &#39;</span> +</div>
<div class="line"><a name="l08945"></a><span class="lineno"> 8945</span>&#160;                    <span class="stringliteral">&#39;ui-corner-all &#39;</span> +</div>
<div class="line"><a name="l08946"></a><span class="lineno"> 8946</span>&#160;                    <span class="stringliteral">&#39;ui-helper-clearfix&#39;</span></div>
<div class="line"><a name="l08947"></a><span class="lineno"> 8947</span>&#160;                )</div>
<div class="line"><a name="l08948"></a><span class="lineno"> 8948</span>&#160;                .prependTo(uiDialog),</div>
<div class="line"><a name="l08949"></a><span class="lineno"> 8949</span>&#160;</div>
<div class="line"><a name="l08950"></a><span class="lineno"> 8950</span>&#160;            uiDialogTitlebarClose = $(<span class="stringliteral">&#39;&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;&#39;</span>)</div>
<div class="line"><a name="l08951"></a><span class="lineno"> 8951</span>&#160;                .addClass(</div>
<div class="line"><a name="l08952"></a><span class="lineno"> 8952</span>&#160;                    <span class="stringliteral">&#39;ui-dialog-titlebar-close &#39;</span> +</div>
<div class="line"><a name="l08953"></a><span class="lineno"> 8953</span>&#160;                    <span class="stringliteral">&#39;ui-corner-all&#39;</span></div>
<div class="line"><a name="l08954"></a><span class="lineno"> 8954</span>&#160;                )</div>
<div class="line"><a name="l08955"></a><span class="lineno"> 8955</span>&#160;                .attr(<span class="stringliteral">&#39;role&#39;</span>, <span class="stringliteral">&#39;button&#39;</span>)</div>
<div class="line"><a name="l08956"></a><span class="lineno"> 8956</span>&#160;                .hover(</div>
<div class="line"><a name="l08957"></a><span class="lineno"> 8957</span>&#160;                    <span class="keyword">function</span>() {</div>
<div class="line"><a name="l08958"></a><span class="lineno"> 8958</span>&#160;                        uiDialogTitlebarClose.addClass(<span class="stringliteral">&#39;ui-state-hover&#39;</span>);</div>
<div class="line"><a name="l08959"></a><span class="lineno"> 8959</span>&#160;                    },</div>
<div class="line"><a name="l08960"></a><span class="lineno"> 8960</span>&#160;                    <span class="keyword">function</span>() {</div>
<div class="line"><a name="l08961"></a><span class="lineno"> 8961</span>&#160;                        uiDialogTitlebarClose.removeClass(<span class="stringliteral">&#39;ui-state-hover&#39;</span>);</div>
<div class="line"><a name="l08962"></a><span class="lineno"> 8962</span>&#160;                    }</div>
<div class="line"><a name="l08963"></a><span class="lineno"> 8963</span>&#160;                )</div>
<div class="line"><a name="l08964"></a><span class="lineno"> 8964</span>&#160;                .focus(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l08965"></a><span class="lineno"> 8965</span>&#160;                    uiDialogTitlebarClose.addClass(<span class="stringliteral">&#39;ui-state-focus&#39;</span>);</div>
<div class="line"><a name="l08966"></a><span class="lineno"> 8966</span>&#160;                })</div>
<div class="line"><a name="l08967"></a><span class="lineno"> 8967</span>&#160;                .blur(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l08968"></a><span class="lineno"> 8968</span>&#160;                    uiDialogTitlebarClose.removeClass(<span class="stringliteral">&#39;ui-state-focus&#39;</span>);</div>
<div class="line"><a name="l08969"></a><span class="lineno"> 8969</span>&#160;                })</div>
<div class="line"><a name="l08970"></a><span class="lineno"> 8970</span>&#160;                .click(<span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l08971"></a><span class="lineno"> 8971</span>&#160;                    <span class="keyword">self</span>.close(event);</div>
<div class="line"><a name="l08972"></a><span class="lineno"> 8972</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l08973"></a><span class="lineno"> 8973</span>&#160;                })</div>
<div class="line"><a name="l08974"></a><span class="lineno"> 8974</span>&#160;                .appendTo(uiDialogTitlebar),</div>
<div class="line"><a name="l08975"></a><span class="lineno"> 8975</span>&#160;</div>
<div class="line"><a name="l08976"></a><span class="lineno"> 8976</span>&#160;            uiDialogTitlebarCloseText = (<span class="keyword">self</span>.uiDialogTitlebarCloseText = $(<span class="stringliteral">&#39;&lt;span&gt;&lt;/span&gt;&#39;</span>))</div>
<div class="line"><a name="l08977"></a><span class="lineno"> 8977</span>&#160;                .addClass(</div>
<div class="line"><a name="l08978"></a><span class="lineno"> 8978</span>&#160;                    <span class="stringliteral">&#39;ui-icon &#39;</span> +</div>
<div class="line"><a name="l08979"></a><span class="lineno"> 8979</span>&#160;                    <span class="stringliteral">&#39;ui-icon-closethick&#39;</span></div>
<div class="line"><a name="l08980"></a><span class="lineno"> 8980</span>&#160;                )</div>
<div class="line"><a name="l08981"></a><span class="lineno"> 8981</span>&#160;                .text(options.closeText)</div>
<div class="line"><a name="l08982"></a><span class="lineno"> 8982</span>&#160;                .appendTo(uiDialogTitlebarClose),</div>
<div class="line"><a name="l08983"></a><span class="lineno"> 8983</span>&#160;</div>
<div class="line"><a name="l08984"></a><span class="lineno"> 8984</span>&#160;            uiDialogTitle = $(<span class="stringliteral">&#39;&lt;span&gt;&lt;/span&gt;&#39;</span>)</div>
<div class="line"><a name="l08985"></a><span class="lineno"> 8985</span>&#160;                .addClass(<span class="stringliteral">&#39;ui-dialog-title&#39;</span>)</div>
<div class="line"><a name="l08986"></a><span class="lineno"> 8986</span>&#160;                .attr(<span class="stringliteral">&#39;id&#39;</span>, titleId)</div>
<div class="line"><a name="l08987"></a><span class="lineno"> 8987</span>&#160;                .html(title)</div>
<div class="line"><a name="l08988"></a><span class="lineno"> 8988</span>&#160;                .prependTo(uiDialogTitlebar);</div>
<div class="line"><a name="l08989"></a><span class="lineno"> 8989</span>&#160;</div>
<div class="line"><a name="l08990"></a><span class="lineno"> 8990</span>&#160;        <span class="comment">//handling of deprecated beforeclose (vs beforeClose) option</span></div>
<div class="line"><a name="l08991"></a><span class="lineno"> 8991</span>&#160;        <span class="comment">//Ticket #4669 http://dev.jqueryui.com/ticket/4669</span></div>
<div class="line"><a name="l08992"></a><span class="lineno"> 8992</span>&#160;        <span class="comment">//TODO: remove in 1.9pre</span></div>
<div class="line"><a name="l08993"></a><span class="lineno"> 8993</span>&#160;        <span class="keywordflow">if</span> ($.isFunction(options.beforeclose) &amp;&amp; !$.isFunction(options.beforeClose)) {</div>
<div class="line"><a name="l08994"></a><span class="lineno"> 8994</span>&#160;            options.beforeClose = options.beforeclose;</div>
<div class="line"><a name="l08995"></a><span class="lineno"> 8995</span>&#160;        }</div>
<div class="line"><a name="l08996"></a><span class="lineno"> 8996</span>&#160;</div>
<div class="line"><a name="l08997"></a><span class="lineno"> 8997</span>&#160;        uiDialogTitlebar.find(<span class="stringliteral">&quot;*&quot;</span>).add(uiDialogTitlebar).disableSelection();</div>
<div class="line"><a name="l08998"></a><span class="lineno"> 8998</span>&#160;</div>
<div class="line"><a name="l08999"></a><span class="lineno"> 8999</span>&#160;        <span class="keywordflow">if</span> (options.draggable &amp;&amp; $.fn.draggable) {</div>
<div class="line"><a name="l09000"></a><span class="lineno"> 9000</span>&#160;            <span class="keyword">self</span>._makeDraggable();</div>
<div class="line"><a name="l09001"></a><span class="lineno"> 9001</span>&#160;        }</div>
<div class="line"><a name="l09002"></a><span class="lineno"> 9002</span>&#160;        <span class="keywordflow">if</span> (options.resizable &amp;&amp; $.fn.resizable) {</div>
<div class="line"><a name="l09003"></a><span class="lineno"> 9003</span>&#160;            <span class="keyword">self</span>._makeResizable();</div>
<div class="line"><a name="l09004"></a><span class="lineno"> 9004</span>&#160;        }</div>
<div class="line"><a name="l09005"></a><span class="lineno"> 9005</span>&#160;</div>
<div class="line"><a name="l09006"></a><span class="lineno"> 9006</span>&#160;        <span class="keyword">self</span>._createButtons(options.buttons);</div>
<div class="line"><a name="l09007"></a><span class="lineno"> 9007</span>&#160;        <span class="keyword">self</span>._isOpen = <span class="keyword">false</span>;</div>
<div class="line"><a name="l09008"></a><span class="lineno"> 9008</span>&#160;</div>
<div class="line"><a name="l09009"></a><span class="lineno"> 9009</span>&#160;        <span class="keywordflow">if</span> ($.fn.bgiframe) {</div>
<div class="line"><a name="l09010"></a><span class="lineno"> 9010</span>&#160;            uiDialog.bgiframe();</div>
<div class="line"><a name="l09011"></a><span class="lineno"> 9011</span>&#160;        }</div>
<div class="line"><a name="l09012"></a><span class="lineno"> 9012</span>&#160;    },</div>
<div class="line"><a name="l09013"></a><span class="lineno"> 9013</span>&#160;</div>
<div class="line"><a name="l09014"></a><span class="lineno"> 9014</span>&#160;    _init: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09015"></a><span class="lineno"> 9015</span>&#160;        <span class="keywordflow">if</span> ( this.options.autoOpen ) {</div>
<div class="line"><a name="l09016"></a><span class="lineno"> 9016</span>&#160;            this.open();</div>
<div class="line"><a name="l09017"></a><span class="lineno"> 9017</span>&#160;        }</div>
<div class="line"><a name="l09018"></a><span class="lineno"> 9018</span>&#160;    },</div>
<div class="line"><a name="l09019"></a><span class="lineno"> 9019</span>&#160;</div>
<div class="line"><a name="l09020"></a><span class="lineno"> 9020</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09021"></a><span class="lineno"> 9021</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l09022"></a><span class="lineno"> 9022</span>&#160;        </div>
<div class="line"><a name="l09023"></a><span class="lineno"> 9023</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.overlay) {</div>
<div class="line"><a name="l09024"></a><span class="lineno"> 9024</span>&#160;            <span class="keyword">self</span>.overlay.destroy();</div>
<div class="line"><a name="l09025"></a><span class="lineno"> 9025</span>&#160;        }</div>
<div class="line"><a name="l09026"></a><span class="lineno"> 9026</span>&#160;        <span class="keyword">self</span>.uiDialog.hide();</div>
<div class="line"><a name="l09027"></a><span class="lineno"> 9027</span>&#160;        <span class="keyword">self</span>.element</div>
<div class="line"><a name="l09028"></a><span class="lineno"> 9028</span>&#160;            .unbind(<span class="stringliteral">&#39;.dialog&#39;</span>)</div>
<div class="line"><a name="l09029"></a><span class="lineno"> 9029</span>&#160;            .removeData(<span class="stringliteral">&#39;dialog&#39;</span>)</div>
<div class="line"><a name="l09030"></a><span class="lineno"> 9030</span>&#160;            .removeClass(<span class="stringliteral">&#39;ui-dialog-content ui-widget-content&#39;</span>)</div>
<div class="line"><a name="l09031"></a><span class="lineno"> 9031</span>&#160;            .hide().appendTo(<span class="stringliteral">&#39;body&#39;</span>);</div>
<div class="line"><a name="l09032"></a><span class="lineno"> 9032</span>&#160;        <span class="keyword">self</span>.uiDialog.remove();</div>
<div class="line"><a name="l09033"></a><span class="lineno"> 9033</span>&#160;</div>
<div class="line"><a name="l09034"></a><span class="lineno"> 9034</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.originalTitle) {</div>
<div class="line"><a name="l09035"></a><span class="lineno"> 9035</span>&#160;            <span class="keyword">self</span>.element.attr(<span class="stringliteral">&#39;title&#39;</span>, <span class="keyword">self</span>.originalTitle);</div>
<div class="line"><a name="l09036"></a><span class="lineno"> 9036</span>&#160;        }</div>
<div class="line"><a name="l09037"></a><span class="lineno"> 9037</span>&#160;</div>
<div class="line"><a name="l09038"></a><span class="lineno"> 9038</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">self</span>;</div>
<div class="line"><a name="l09039"></a><span class="lineno"> 9039</span>&#160;    },</div>
<div class="line"><a name="l09040"></a><span class="lineno"> 9040</span>&#160;</div>
<div class="line"><a name="l09041"></a><span class="lineno"> 9041</span>&#160;    widget: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09042"></a><span class="lineno"> 9042</span>&#160;        <span class="keywordflow">return</span> this.uiDialog;</div>
<div class="line"><a name="l09043"></a><span class="lineno"> 9043</span>&#160;    },</div>
<div class="line"><a name="l09044"></a><span class="lineno"> 9044</span>&#160;</div>
<div class="line"><a name="l09045"></a><span class="lineno"> 9045</span>&#160;    close: <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l09046"></a><span class="lineno"> 9046</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09047"></a><span class="lineno"> 9047</span>&#160;            maxZ, thisZ;</div>
<div class="line"><a name="l09048"></a><span class="lineno"> 9048</span>&#160;        </div>
<div class="line"><a name="l09049"></a><span class="lineno"> 9049</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">false</span> === <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;beforeClose&#39;</span>, event)) {</div>
<div class="line"><a name="l09050"></a><span class="lineno"> 9050</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l09051"></a><span class="lineno"> 9051</span>&#160;        }</div>
<div class="line"><a name="l09052"></a><span class="lineno"> 9052</span>&#160;</div>
<div class="line"><a name="l09053"></a><span class="lineno"> 9053</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.overlay) {</div>
<div class="line"><a name="l09054"></a><span class="lineno"> 9054</span>&#160;            <span class="keyword">self</span>.overlay.destroy();</div>
<div class="line"><a name="l09055"></a><span class="lineno"> 9055</span>&#160;        }</div>
<div class="line"><a name="l09056"></a><span class="lineno"> 9056</span>&#160;        <span class="keyword">self</span>.uiDialog.unbind(<span class="stringliteral">&#39;keypress.ui-dialog&#39;</span>);</div>
<div class="line"><a name="l09057"></a><span class="lineno"> 9057</span>&#160;</div>
<div class="line"><a name="l09058"></a><span class="lineno"> 9058</span>&#160;        <span class="keyword">self</span>._isOpen = <span class="keyword">false</span>;</div>
<div class="line"><a name="l09059"></a><span class="lineno"> 9059</span>&#160;</div>
<div class="line"><a name="l09060"></a><span class="lineno"> 9060</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.options.hide) {</div>
<div class="line"><a name="l09061"></a><span class="lineno"> 9061</span>&#160;            <span class="keyword">self</span>.uiDialog.hide(<span class="keyword">self</span>.options.hide, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09062"></a><span class="lineno"> 9062</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;close&#39;</span>, event);</div>
<div class="line"><a name="l09063"></a><span class="lineno"> 9063</span>&#160;            });</div>
<div class="line"><a name="l09064"></a><span class="lineno"> 9064</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09065"></a><span class="lineno"> 9065</span>&#160;            <span class="keyword">self</span>.uiDialog.hide();</div>
<div class="line"><a name="l09066"></a><span class="lineno"> 9066</span>&#160;            <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;close&#39;</span>, event);</div>
<div class="line"><a name="l09067"></a><span class="lineno"> 9067</span>&#160;        }</div>
<div class="line"><a name="l09068"></a><span class="lineno"> 9068</span>&#160;</div>
<div class="line"><a name="l09069"></a><span class="lineno"> 9069</span>&#160;        $.ui.dialog.overlay.resize();</div>
<div class="line"><a name="l09070"></a><span class="lineno"> 9070</span>&#160;</div>
<div class="line"><a name="l09071"></a><span class="lineno"> 9071</span>&#160;        <span class="comment">// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)</span></div>
<div class="line"><a name="l09072"></a><span class="lineno"> 9072</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.options.modal) {</div>
<div class="line"><a name="l09073"></a><span class="lineno"> 9073</span>&#160;            maxZ = 0;</div>
<div class="line"><a name="l09074"></a><span class="lineno"> 9074</span>&#160;            $(<span class="stringliteral">&#39;.ui-dialog&#39;</span>).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l09075"></a><span class="lineno"> 9075</span>&#160;                <span class="keywordflow">if</span> (<span class="keyword">this</span> !== <span class="keyword">self</span>.uiDialog[0]) {</div>
<div class="line"><a name="l09076"></a><span class="lineno"> 9076</span>&#160;                    thisZ = $(<span class="keyword">this</span>).css(<span class="stringliteral">&#39;z-index&#39;</span>);</div>
<div class="line"><a name="l09077"></a><span class="lineno"> 9077</span>&#160;                    <span class="keywordflow">if</span>(!isNaN(thisZ)) {</div>
<div class="line"><a name="l09078"></a><span class="lineno"> 9078</span>&#160;                        maxZ = Math.max(maxZ, thisZ);</div>
<div class="line"><a name="l09079"></a><span class="lineno"> 9079</span>&#160;                    }</div>
<div class="line"><a name="l09080"></a><span class="lineno"> 9080</span>&#160;                }</div>
<div class="line"><a name="l09081"></a><span class="lineno"> 9081</span>&#160;            });</div>
<div class="line"><a name="l09082"></a><span class="lineno"> 9082</span>&#160;            $.ui.dialog.maxZ = maxZ;</div>
<div class="line"><a name="l09083"></a><span class="lineno"> 9083</span>&#160;        }</div>
<div class="line"><a name="l09084"></a><span class="lineno"> 9084</span>&#160;</div>
<div class="line"><a name="l09085"></a><span class="lineno"> 9085</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">self</span>;</div>
<div class="line"><a name="l09086"></a><span class="lineno"> 9086</span>&#160;    },</div>
<div class="line"><a name="l09087"></a><span class="lineno"> 9087</span>&#160;</div>
<div class="line"><a name="l09088"></a><span class="lineno"> 9088</span>&#160;    isOpen: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09089"></a><span class="lineno"> 9089</span>&#160;        <span class="keywordflow">return</span> this._isOpen;</div>
<div class="line"><a name="l09090"></a><span class="lineno"> 9090</span>&#160;    },</div>
<div class="line"><a name="l09091"></a><span class="lineno"> 9091</span>&#160;</div>
<div class="line"><a name="l09092"></a><span class="lineno"> 9092</span>&#160;    <span class="comment">// the force parameter allows us to move modal dialogs to their correct</span></div>
<div class="line"><a name="l09093"></a><span class="lineno"> 9093</span>&#160;    <span class="comment">// position on open</span></div>
<div class="line"><a name="l09094"></a><span class="lineno"> 9094</span>&#160;    moveToTop: <span class="keyword">function</span>(force, event) {</div>
<div class="line"><a name="l09095"></a><span class="lineno"> 9095</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09096"></a><span class="lineno"> 9096</span>&#160;            options = <span class="keyword">self</span>.options,</div>
<div class="line"><a name="l09097"></a><span class="lineno"> 9097</span>&#160;            saveScroll;</div>
<div class="line"><a name="l09098"></a><span class="lineno"> 9098</span>&#160;</div>
<div class="line"><a name="l09099"></a><span class="lineno"> 9099</span>&#160;        <span class="keywordflow">if</span> ((options.modal &amp;&amp; !force) ||</div>
<div class="line"><a name="l09100"></a><span class="lineno"> 9100</span>&#160;            (!options.stack &amp;&amp; !options.modal)) {</div>
<div class="line"><a name="l09101"></a><span class="lineno"> 9101</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;focus&#39;</span>, event);</div>
<div class="line"><a name="l09102"></a><span class="lineno"> 9102</span>&#160;        }</div>
<div class="line"><a name="l09103"></a><span class="lineno"> 9103</span>&#160;</div>
<div class="line"><a name="l09104"></a><span class="lineno"> 9104</span>&#160;        <span class="keywordflow">if</span> (options.zIndex &gt; $.ui.dialog.maxZ) {</div>
<div class="line"><a name="l09105"></a><span class="lineno"> 9105</span>&#160;            $.ui.dialog.maxZ = options.zIndex;</div>
<div class="line"><a name="l09106"></a><span class="lineno"> 9106</span>&#160;        }</div>
<div class="line"><a name="l09107"></a><span class="lineno"> 9107</span>&#160;        <span class="keywordflow">if</span> (<span class="keyword">self</span>.overlay) {</div>
<div class="line"><a name="l09108"></a><span class="lineno"> 9108</span>&#160;            $.ui.dialog.maxZ += 1;</div>
<div class="line"><a name="l09109"></a><span class="lineno"> 9109</span>&#160;            <span class="keyword">self</span>.overlay.$el.css(<span class="stringliteral">&#39;z-index&#39;</span>, $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);</div>
<div class="line"><a name="l09110"></a><span class="lineno"> 9110</span>&#160;        }</div>
<div class="line"><a name="l09111"></a><span class="lineno"> 9111</span>&#160;</div>
<div class="line"><a name="l09112"></a><span class="lineno"> 9112</span>&#160;        <span class="comment">//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.</span></div>
<div class="line"><a name="l09113"></a><span class="lineno"> 9113</span>&#160;        <span class="comment">//  http://ui.jquery.com/bugs/ticket/3193</span></div>
<div class="line"><a name="l09114"></a><span class="lineno"> 9114</span>&#160;        saveScroll = { scrollTop: <span class="keyword">self</span>.element.scrollTop(), scrollLeft: <span class="keyword">self</span>.element.scrollLeft() };</div>
<div class="line"><a name="l09115"></a><span class="lineno"> 9115</span>&#160;        $.ui.dialog.maxZ += 1;</div>
<div class="line"><a name="l09116"></a><span class="lineno"> 9116</span>&#160;        <span class="keyword">self</span>.uiDialog.css(<span class="stringliteral">&#39;z-index&#39;</span>, $.ui.dialog.maxZ);</div>
<div class="line"><a name="l09117"></a><span class="lineno"> 9117</span>&#160;        <span class="keyword">self</span>.element.attr(saveScroll);</div>
<div class="line"><a name="l09118"></a><span class="lineno"> 9118</span>&#160;        <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;focus&#39;</span>, event);</div>
<div class="line"><a name="l09119"></a><span class="lineno"> 9119</span>&#160;</div>
<div class="line"><a name="l09120"></a><span class="lineno"> 9120</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">self</span>;</div>
<div class="line"><a name="l09121"></a><span class="lineno"> 9121</span>&#160;    },</div>
<div class="line"><a name="l09122"></a><span class="lineno"> 9122</span>&#160;</div>
<div class="line"><a name="l09123"></a><span class="lineno"> 9123</span>&#160;    open: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09124"></a><span class="lineno"> 9124</span>&#160;        <span class="keywordflow">if</span> (this._isOpen) { <span class="keywordflow">return</span>; }</div>
<div class="line"><a name="l09125"></a><span class="lineno"> 9125</span>&#160;</div>
<div class="line"><a name="l09126"></a><span class="lineno"> 9126</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09127"></a><span class="lineno"> 9127</span>&#160;            options = <span class="keyword">self</span>.options,</div>
<div class="line"><a name="l09128"></a><span class="lineno"> 9128</span>&#160;            uiDialog = <span class="keyword">self</span>.uiDialog;</div>
<div class="line"><a name="l09129"></a><span class="lineno"> 9129</span>&#160;</div>
<div class="line"><a name="l09130"></a><span class="lineno"> 9130</span>&#160;        <span class="keyword">self</span>.overlay = options.modal ? <span class="keyword">new</span> $.ui.dialog.overlay(<span class="keyword">self</span>) : null;</div>
<div class="line"><a name="l09131"></a><span class="lineno"> 9131</span>&#160;        <span class="keyword">self</span>._size();</div>
<div class="line"><a name="l09132"></a><span class="lineno"> 9132</span>&#160;        <span class="keyword">self</span>._position(options.position);</div>
<div class="line"><a name="l09133"></a><span class="lineno"> 9133</span>&#160;        uiDialog.show(options.show);</div>
<div class="line"><a name="l09134"></a><span class="lineno"> 9134</span>&#160;        <span class="keyword">self</span>.moveToTop(<span class="keyword">true</span>);</div>
<div class="line"><a name="l09135"></a><span class="lineno"> 9135</span>&#160;</div>
<div class="line"><a name="l09136"></a><span class="lineno"> 9136</span>&#160;        <span class="comment">// prevent tabbing out of modal dialogs</span></div>
<div class="line"><a name="l09137"></a><span class="lineno"> 9137</span>&#160;        <span class="keywordflow">if</span> ( options.modal ) {</div>
<div class="line"><a name="l09138"></a><span class="lineno"> 9138</span>&#160;            uiDialog.bind( <span class="stringliteral">&quot;keydown.ui-dialog&quot;</span>, <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l09139"></a><span class="lineno"> 9139</span>&#160;                <span class="keywordflow">if</span> ( event.keyCode !== $.ui.keyCode.TAB ) {</div>
<div class="line"><a name="l09140"></a><span class="lineno"> 9140</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l09141"></a><span class="lineno"> 9141</span>&#160;                }</div>
<div class="line"><a name="l09142"></a><span class="lineno"> 9142</span>&#160;</div>
<div class="line"><a name="l09143"></a><span class="lineno"> 9143</span>&#160;                var tabbables = $(<span class="stringliteral">&#39;:tabbable&#39;</span>, <span class="keyword">this</span>),</div>
<div class="line"><a name="l09144"></a><span class="lineno"> 9144</span>&#160;                    first = tabbables.filter(<span class="stringliteral">&#39;:first&#39;</span>),</div>
<div class="line"><a name="l09145"></a><span class="lineno"> 9145</span>&#160;                    last  = tabbables.filter(<span class="stringliteral">&#39;:last&#39;</span>);</div>
<div class="line"><a name="l09146"></a><span class="lineno"> 9146</span>&#160;</div>
<div class="line"><a name="l09147"></a><span class="lineno"> 9147</span>&#160;                <span class="keywordflow">if</span> (event.target === last[0] &amp;&amp; !event.shiftKey) {</div>
<div class="line"><a name="l09148"></a><span class="lineno"> 9148</span>&#160;                    first.focus(1);</div>
<div class="line"><a name="l09149"></a><span class="lineno"> 9149</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l09150"></a><span class="lineno"> 9150</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event.target === first[0] &amp;&amp; event.shiftKey) {</div>
<div class="line"><a name="l09151"></a><span class="lineno"> 9151</span>&#160;                    last.focus(1);</div>
<div class="line"><a name="l09152"></a><span class="lineno"> 9152</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l09153"></a><span class="lineno"> 9153</span>&#160;                }</div>
<div class="line"><a name="l09154"></a><span class="lineno"> 9154</span>&#160;            });</div>
<div class="line"><a name="l09155"></a><span class="lineno"> 9155</span>&#160;        }</div>
<div class="line"><a name="l09156"></a><span class="lineno"> 9156</span>&#160;</div>
<div class="line"><a name="l09157"></a><span class="lineno"> 9157</span>&#160;        <span class="comment">// set focus to the first tabbable element in the content area or the first button</span></div>
<div class="line"><a name="l09158"></a><span class="lineno"> 9158</span>&#160;        <span class="comment">// if there are no tabbable elements, set focus on the dialog itself</span></div>
<div class="line"><a name="l09159"></a><span class="lineno"> 9159</span>&#160;        $(<span class="keyword">self</span>.element.find(<span class="stringliteral">&#39;:tabbable&#39;</span>).get().concat(</div>
<div class="line"><a name="l09160"></a><span class="lineno"> 9160</span>&#160;            uiDialog.find(<span class="stringliteral">&#39;.ui-dialog-buttonpane :tabbable&#39;</span>).get().concat(</div>
<div class="line"><a name="l09161"></a><span class="lineno"> 9161</span>&#160;                uiDialog.get()))).eq(0).focus();</div>
<div class="line"><a name="l09162"></a><span class="lineno"> 9162</span>&#160;</div>
<div class="line"><a name="l09163"></a><span class="lineno"> 9163</span>&#160;        <span class="keyword">self</span>._isOpen = <span class="keyword">true</span>;</div>
<div class="line"><a name="l09164"></a><span class="lineno"> 9164</span>&#160;        <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;open&#39;</span>);</div>
<div class="line"><a name="l09165"></a><span class="lineno"> 9165</span>&#160;</div>
<div class="line"><a name="l09166"></a><span class="lineno"> 9166</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">self</span>;</div>
<div class="line"><a name="l09167"></a><span class="lineno"> 9167</span>&#160;    },</div>
<div class="line"><a name="l09168"></a><span class="lineno"> 9168</span>&#160;</div>
<div class="line"><a name="l09169"></a><span class="lineno"> 9169</span>&#160;    _createButtons: <span class="keyword">function</span>(buttons) {</div>
<div class="line"><a name="l09170"></a><span class="lineno"> 9170</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09171"></a><span class="lineno"> 9171</span>&#160;            hasButtons = <span class="keyword">false</span>,</div>
<div class="line"><a name="l09172"></a><span class="lineno"> 9172</span>&#160;            uiDialogButtonPane = $(<span class="stringliteral">&#39;&lt;div&gt;&lt;/div&gt;&#39;</span>)</div>
<div class="line"><a name="l09173"></a><span class="lineno"> 9173</span>&#160;                .addClass(</div>
<div class="line"><a name="l09174"></a><span class="lineno"> 9174</span>&#160;                    <span class="stringliteral">&#39;ui-dialog-buttonpane &#39;</span> +</div>
<div class="line"><a name="l09175"></a><span class="lineno"> 9175</span>&#160;                    <span class="stringliteral">&#39;ui-widget-content &#39;</span> +</div>
<div class="line"><a name="l09176"></a><span class="lineno"> 9176</span>&#160;                    <span class="stringliteral">&#39;ui-helper-clearfix&#39;</span></div>
<div class="line"><a name="l09177"></a><span class="lineno"> 9177</span>&#160;                ),</div>
<div class="line"><a name="l09178"></a><span class="lineno"> 9178</span>&#160;            uiButtonSet = $( <span class="stringliteral">&quot;&lt;div&gt;&lt;/div&gt;&quot;</span> )</div>
<div class="line"><a name="l09179"></a><span class="lineno"> 9179</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-dialog-buttonset&quot;</span> )</div>
<div class="line"><a name="l09180"></a><span class="lineno"> 9180</span>&#160;                .appendTo( uiDialogButtonPane );</div>
<div class="line"><a name="l09181"></a><span class="lineno"> 9181</span>&#160;</div>
<div class="line"><a name="l09182"></a><span class="lineno"> 9182</span>&#160;        <span class="comment">// if we already have a button pane, remove it</span></div>
<div class="line"><a name="l09183"></a><span class="lineno"> 9183</span>&#160;        <span class="keyword">self</span>.uiDialog.find(<span class="stringliteral">&#39;.ui-dialog-buttonpane&#39;</span>).remove();</div>
<div class="line"><a name="l09184"></a><span class="lineno"> 9184</span>&#160;</div>
<div class="line"><a name="l09185"></a><span class="lineno"> 9185</span>&#160;        <span class="keywordflow">if</span> (typeof buttons === <span class="stringliteral">&#39;object&#39;</span> &amp;&amp; buttons !== null) {</div>
<div class="line"><a name="l09186"></a><span class="lineno"> 9186</span>&#160;            $.each(buttons, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09187"></a><span class="lineno"> 9187</span>&#160;                <span class="keywordflow">return</span> !(hasButtons = <span class="keyword">true</span>);</div>
<div class="line"><a name="l09188"></a><span class="lineno"> 9188</span>&#160;            });</div>
<div class="line"><a name="l09189"></a><span class="lineno"> 9189</span>&#160;        }</div>
<div class="line"><a name="l09190"></a><span class="lineno"> 9190</span>&#160;        <span class="keywordflow">if</span> (hasButtons) {</div>
<div class="line"><a name="l09191"></a><span class="lineno"> 9191</span>&#160;            $.each(buttons, <span class="keyword">function</span>(name, props) {</div>
<div class="line"><a name="l09192"></a><span class="lineno"> 9192</span>&#160;                props = $.isFunction( props ) ?</div>
<div class="line"><a name="l09193"></a><span class="lineno"> 9193</span>&#160;                    { click: props, text: name } :</div>
<div class="line"><a name="l09194"></a><span class="lineno"> 9194</span>&#160;                    props;</div>
<div class="line"><a name="l09195"></a><span class="lineno"> 9195</span>&#160;                var button = $(<span class="stringliteral">&#39;&lt;button type=&quot;button&quot;&gt;&lt;/button&gt;&#39;</span>)</div>
<div class="line"><a name="l09196"></a><span class="lineno"> 9196</span>&#160;                    .click(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l09197"></a><span class="lineno"> 9197</span>&#160;                        props.click.apply(<span class="keyword">self</span>.element[0], arguments);</div>
<div class="line"><a name="l09198"></a><span class="lineno"> 9198</span>&#160;                    })</div>
<div class="line"><a name="l09199"></a><span class="lineno"> 9199</span>&#160;                    .appendTo(uiButtonSet);</div>
<div class="line"><a name="l09200"></a><span class="lineno"> 9200</span>&#160;                <span class="comment">// can&#39;t use .attr( props, true ) with jQuery 1.3.2.</span></div>
<div class="line"><a name="l09201"></a><span class="lineno"> 9201</span>&#160;                $.each( props, <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l09202"></a><span class="lineno"> 9202</span>&#160;                    <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;click&quot;</span> ) {</div>
<div class="line"><a name="l09203"></a><span class="lineno"> 9203</span>&#160;                        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l09204"></a><span class="lineno"> 9204</span>&#160;                    }</div>
<div class="line"><a name="l09205"></a><span class="lineno"> 9205</span>&#160;                    <span class="keywordflow">if</span> ( key in attrFn ) {</div>
<div class="line"><a name="l09206"></a><span class="lineno"> 9206</span>&#160;                        button[ key ]( value );</div>
<div class="line"><a name="l09207"></a><span class="lineno"> 9207</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09208"></a><span class="lineno"> 9208</span>&#160;                        button.attr( key, value );</div>
<div class="line"><a name="l09209"></a><span class="lineno"> 9209</span>&#160;                    }</div>
<div class="line"><a name="l09210"></a><span class="lineno"> 9210</span>&#160;                });</div>
<div class="line"><a name="l09211"></a><span class="lineno"> 9211</span>&#160;                <span class="keywordflow">if</span> ($.fn.button) {</div>
<div class="line"><a name="l09212"></a><span class="lineno"> 9212</span>&#160;                    button.button();</div>
<div class="line"><a name="l09213"></a><span class="lineno"> 9213</span>&#160;                }</div>
<div class="line"><a name="l09214"></a><span class="lineno"> 9214</span>&#160;            });</div>
<div class="line"><a name="l09215"></a><span class="lineno"> 9215</span>&#160;            uiDialogButtonPane.appendTo(<span class="keyword">self</span>.uiDialog);</div>
<div class="line"><a name="l09216"></a><span class="lineno"> 9216</span>&#160;        }</div>
<div class="line"><a name="l09217"></a><span class="lineno"> 9217</span>&#160;    },</div>
<div class="line"><a name="l09218"></a><span class="lineno"> 9218</span>&#160;</div>
<div class="line"><a name="l09219"></a><span class="lineno"> 9219</span>&#160;    _makeDraggable: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09220"></a><span class="lineno"> 9220</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09221"></a><span class="lineno"> 9221</span>&#160;            options = <span class="keyword">self</span>.options,</div>
<div class="line"><a name="l09222"></a><span class="lineno"> 9222</span>&#160;            doc = $(document),</div>
<div class="line"><a name="l09223"></a><span class="lineno"> 9223</span>&#160;            heightBeforeDrag;</div>
<div class="line"><a name="l09224"></a><span class="lineno"> 9224</span>&#160;</div>
<div class="line"><a name="l09225"></a><span class="lineno"> 9225</span>&#160;        <span class="keyword">function</span> filteredUi(ui) {</div>
<div class="line"><a name="l09226"></a><span class="lineno"> 9226</span>&#160;            <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l09227"></a><span class="lineno"> 9227</span>&#160;                position: ui.position,</div>
<div class="line"><a name="l09228"></a><span class="lineno"> 9228</span>&#160;                offset: ui.offset</div>
<div class="line"><a name="l09229"></a><span class="lineno"> 9229</span>&#160;            };</div>
<div class="line"><a name="l09230"></a><span class="lineno"> 9230</span>&#160;        }</div>
<div class="line"><a name="l09231"></a><span class="lineno"> 9231</span>&#160;</div>
<div class="line"><a name="l09232"></a><span class="lineno"> 9232</span>&#160;        <span class="keyword">self</span>.uiDialog.draggable({</div>
<div class="line"><a name="l09233"></a><span class="lineno"> 9233</span>&#160;            cancel: <span class="stringliteral">&#39;.ui-dialog-content, .ui-dialog-titlebar-close&#39;</span>,</div>
<div class="line"><a name="l09234"></a><span class="lineno"> 9234</span>&#160;            handle: <span class="stringliteral">&#39;.ui-dialog-titlebar&#39;</span>,</div>
<div class="line"><a name="l09235"></a><span class="lineno"> 9235</span>&#160;            containment: <span class="stringliteral">&#39;document&#39;</span>,</div>
<div class="line"><a name="l09236"></a><span class="lineno"> 9236</span>&#160;            start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l09237"></a><span class="lineno"> 9237</span>&#160;                heightBeforeDrag = options.height === <span class="stringliteral">&quot;auto&quot;</span> ? <span class="stringliteral">&quot;auto&quot;</span> : $(<span class="keyword">this</span>).height();</div>
<div class="line"><a name="l09238"></a><span class="lineno"> 9238</span>&#160;                $(<span class="keyword">this</span>).height($(<span class="keyword">this</span>).height()).addClass(<span class="stringliteral">&quot;ui-dialog-dragging&quot;</span>);</div>
<div class="line"><a name="l09239"></a><span class="lineno"> 9239</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;dragStart&#39;</span>, event, filteredUi(ui));</div>
<div class="line"><a name="l09240"></a><span class="lineno"> 9240</span>&#160;            },</div>
<div class="line"><a name="l09241"></a><span class="lineno"> 9241</span>&#160;            drag: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l09242"></a><span class="lineno"> 9242</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;drag&#39;</span>, event, filteredUi(ui));</div>
<div class="line"><a name="l09243"></a><span class="lineno"> 9243</span>&#160;            },</div>
<div class="line"><a name="l09244"></a><span class="lineno"> 9244</span>&#160;            stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l09245"></a><span class="lineno"> 9245</span>&#160;                options.position = [ui.position.left - doc.scrollLeft(),</div>
<div class="line"><a name="l09246"></a><span class="lineno"> 9246</span>&#160;                    ui.position.top - doc.scrollTop()];</div>
<div class="line"><a name="l09247"></a><span class="lineno"> 9247</span>&#160;                $(<span class="keyword">this</span>).removeClass(<span class="stringliteral">&quot;ui-dialog-dragging&quot;</span>).height(heightBeforeDrag);</div>
<div class="line"><a name="l09248"></a><span class="lineno"> 9248</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;dragStop&#39;</span>, event, filteredUi(ui));</div>
<div class="line"><a name="l09249"></a><span class="lineno"> 9249</span>&#160;                $.ui.dialog.overlay.resize();</div>
<div class="line"><a name="l09250"></a><span class="lineno"> 9250</span>&#160;            }</div>
<div class="line"><a name="l09251"></a><span class="lineno"> 9251</span>&#160;        });</div>
<div class="line"><a name="l09252"></a><span class="lineno"> 9252</span>&#160;    },</div>
<div class="line"><a name="l09253"></a><span class="lineno"> 9253</span>&#160;</div>
<div class="line"><a name="l09254"></a><span class="lineno"> 9254</span>&#160;    _makeResizable: <span class="keyword">function</span>(handles) {</div>
<div class="line"><a name="l09255"></a><span class="lineno"> 9255</span>&#160;        handles = (handles === undefined ? this.options.resizable : handles);</div>
<div class="line"><a name="l09256"></a><span class="lineno"> 9256</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09257"></a><span class="lineno"> 9257</span>&#160;            options = <span class="keyword">self</span>.options,</div>
<div class="line"><a name="l09258"></a><span class="lineno"> 9258</span>&#160;            <span class="comment">// .ui-resizable has position: relative defined in the stylesheet</span></div>
<div class="line"><a name="l09259"></a><span class="lineno"> 9259</span>&#160;            <span class="comment">// but dialogs have to use absolute or fixed positioning</span></div>
<div class="line"><a name="l09260"></a><span class="lineno"> 9260</span>&#160;            position = <span class="keyword">self</span>.uiDialog.css(<span class="stringliteral">&#39;position&#39;</span>),</div>
<div class="line"><a name="l09261"></a><span class="lineno"> 9261</span>&#160;            resizeHandles = (typeof handles === <span class="stringliteral">&#39;string&#39;</span> ?</div>
<div class="line"><a name="l09262"></a><span class="lineno"> 9262</span>&#160;                handles :</div>
<div class="line"><a name="l09263"></a><span class="lineno"> 9263</span>&#160;                <span class="stringliteral">&#39;n,e,s,w,se,sw,ne,nw&#39;</span></div>
<div class="line"><a name="l09264"></a><span class="lineno"> 9264</span>&#160;            );</div>
<div class="line"><a name="l09265"></a><span class="lineno"> 9265</span>&#160;</div>
<div class="line"><a name="l09266"></a><span class="lineno"> 9266</span>&#160;        <span class="keyword">function</span> filteredUi(ui) {</div>
<div class="line"><a name="l09267"></a><span class="lineno"> 9267</span>&#160;            <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l09268"></a><span class="lineno"> 9268</span>&#160;                originalPosition: ui.originalPosition,</div>
<div class="line"><a name="l09269"></a><span class="lineno"> 9269</span>&#160;                originalSize: ui.originalSize,</div>
<div class="line"><a name="l09270"></a><span class="lineno"> 9270</span>&#160;                position: ui.position,</div>
<div class="line"><a name="l09271"></a><span class="lineno"> 9271</span>&#160;                size: ui.size</div>
<div class="line"><a name="l09272"></a><span class="lineno"> 9272</span>&#160;            };</div>
<div class="line"><a name="l09273"></a><span class="lineno"> 9273</span>&#160;        }</div>
<div class="line"><a name="l09274"></a><span class="lineno"> 9274</span>&#160;</div>
<div class="line"><a name="l09275"></a><span class="lineno"> 9275</span>&#160;        <span class="keyword">self</span>.uiDialog.resizable({</div>
<div class="line"><a name="l09276"></a><span class="lineno"> 9276</span>&#160;            cancel: <span class="stringliteral">&#39;.ui-dialog-content&#39;</span>,</div>
<div class="line"><a name="l09277"></a><span class="lineno"> 9277</span>&#160;            containment: <span class="stringliteral">&#39;document&#39;</span>,</div>
<div class="line"><a name="l09278"></a><span class="lineno"> 9278</span>&#160;            alsoResize: <span class="keyword">self</span>.element,</div>
<div class="line"><a name="l09279"></a><span class="lineno"> 9279</span>&#160;            maxWidth: options.maxWidth,</div>
<div class="line"><a name="l09280"></a><span class="lineno"> 9280</span>&#160;            maxHeight: options.maxHeight,</div>
<div class="line"><a name="l09281"></a><span class="lineno"> 9281</span>&#160;            minWidth: options.minWidth,</div>
<div class="line"><a name="l09282"></a><span class="lineno"> 9282</span>&#160;            minHeight: <span class="keyword">self</span>._minHeight(),</div>
<div class="line"><a name="l09283"></a><span class="lineno"> 9283</span>&#160;            handles: resizeHandles,</div>
<div class="line"><a name="l09284"></a><span class="lineno"> 9284</span>&#160;            start: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l09285"></a><span class="lineno"> 9285</span>&#160;                $(<span class="keyword">this</span>).addClass(<span class="stringliteral">&quot;ui-dialog-resizing&quot;</span>);</div>
<div class="line"><a name="l09286"></a><span class="lineno"> 9286</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;resizeStart&#39;</span>, event, filteredUi(ui));</div>
<div class="line"><a name="l09287"></a><span class="lineno"> 9287</span>&#160;            },</div>
<div class="line"><a name="l09288"></a><span class="lineno"> 9288</span>&#160;            resize: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l09289"></a><span class="lineno"> 9289</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;resize&#39;</span>, event, filteredUi(ui));</div>
<div class="line"><a name="l09290"></a><span class="lineno"> 9290</span>&#160;            },</div>
<div class="line"><a name="l09291"></a><span class="lineno"> 9291</span>&#160;            stop: <span class="keyword">function</span>(event, ui) {</div>
<div class="line"><a name="l09292"></a><span class="lineno"> 9292</span>&#160;                $(<span class="keyword">this</span>).removeClass(<span class="stringliteral">&quot;ui-dialog-resizing&quot;</span>);</div>
<div class="line"><a name="l09293"></a><span class="lineno"> 9293</span>&#160;                options.height = $(<span class="keyword">this</span>).height();</div>
<div class="line"><a name="l09294"></a><span class="lineno"> 9294</span>&#160;                options.width = $(<span class="keyword">this</span>).width();</div>
<div class="line"><a name="l09295"></a><span class="lineno"> 9295</span>&#160;                <span class="keyword">self</span>._trigger(<span class="stringliteral">&#39;resizeStop&#39;</span>, event, filteredUi(ui));</div>
<div class="line"><a name="l09296"></a><span class="lineno"> 9296</span>&#160;                $.ui.dialog.overlay.resize();</div>
<div class="line"><a name="l09297"></a><span class="lineno"> 9297</span>&#160;            }</div>
<div class="line"><a name="l09298"></a><span class="lineno"> 9298</span>&#160;        })</div>
<div class="line"><a name="l09299"></a><span class="lineno"> 9299</span>&#160;        .css(<span class="stringliteral">&#39;position&#39;</span>, position)</div>
<div class="line"><a name="l09300"></a><span class="lineno"> 9300</span>&#160;        .find(<span class="stringliteral">&#39;.ui-resizable-se&#39;</span>).addClass(<span class="stringliteral">&#39;ui-icon ui-icon-grip-diagonal-se&#39;</span>);</div>
<div class="line"><a name="l09301"></a><span class="lineno"> 9301</span>&#160;    },</div>
<div class="line"><a name="l09302"></a><span class="lineno"> 9302</span>&#160;</div>
<div class="line"><a name="l09303"></a><span class="lineno"> 9303</span>&#160;    _minHeight: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09304"></a><span class="lineno"> 9304</span>&#160;        var options = this.options;</div>
<div class="line"><a name="l09305"></a><span class="lineno"> 9305</span>&#160;</div>
<div class="line"><a name="l09306"></a><span class="lineno"> 9306</span>&#160;        <span class="keywordflow">if</span> (options.height === <span class="stringliteral">&#39;auto&#39;</span>) {</div>
<div class="line"><a name="l09307"></a><span class="lineno"> 9307</span>&#160;            <span class="keywordflow">return</span> options.minHeight;</div>
<div class="line"><a name="l09308"></a><span class="lineno"> 9308</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09309"></a><span class="lineno"> 9309</span>&#160;            <span class="keywordflow">return</span> Math.min(options.minHeight, options.height);</div>
<div class="line"><a name="l09310"></a><span class="lineno"> 9310</span>&#160;        }</div>
<div class="line"><a name="l09311"></a><span class="lineno"> 9311</span>&#160;    },</div>
<div class="line"><a name="l09312"></a><span class="lineno"> 9312</span>&#160;</div>
<div class="line"><a name="l09313"></a><span class="lineno"> 9313</span>&#160;    _position: <span class="keyword">function</span>(position) {</div>
<div class="line"><a name="l09314"></a><span class="lineno"> 9314</span>&#160;        var myAt = [],</div>
<div class="line"><a name="l09315"></a><span class="lineno"> 9315</span>&#160;            offset = [0, 0],</div>
<div class="line"><a name="l09316"></a><span class="lineno"> 9316</span>&#160;            isVisible;</div>
<div class="line"><a name="l09317"></a><span class="lineno"> 9317</span>&#160;</div>
<div class="line"><a name="l09318"></a><span class="lineno"> 9318</span>&#160;        <span class="keywordflow">if</span> (position) {</div>
<div class="line"><a name="l09319"></a><span class="lineno"> 9319</span>&#160;            <span class="comment">// deep extending converts arrays to objects in jQuery &lt;= 1.3.2 :-(</span></div>
<div class="line"><a name="l09320"></a><span class="lineno"> 9320</span>&#160;    <span class="comment">//      if (typeof position == &#39;string&#39; || $.isArray(position)) {</span></div>
<div class="line"><a name="l09321"></a><span class="lineno"> 9321</span>&#160;    <span class="comment">//          myAt = $.isArray(position) ? position : position.split(&#39; &#39;);</span></div>
<div class="line"><a name="l09322"></a><span class="lineno"> 9322</span>&#160;</div>
<div class="line"><a name="l09323"></a><span class="lineno"> 9323</span>&#160;            <span class="keywordflow">if</span> (typeof position === <span class="stringliteral">&#39;string&#39;</span> || (typeof position === <span class="stringliteral">&#39;object&#39;</span> &amp;&amp; <span class="charliteral">&#39;0&#39;</span> in position)) {</div>
<div class="line"><a name="l09324"></a><span class="lineno"> 9324</span>&#160;                myAt = position.split ? position.split(<span class="charliteral">&#39; &#39;</span>) : [position[0], position[1]];</div>
<div class="line"><a name="l09325"></a><span class="lineno"> 9325</span>&#160;                <span class="keywordflow">if</span> (myAt.length === 1) {</div>
<div class="line"><a name="l09326"></a><span class="lineno"> 9326</span>&#160;                    myAt[1] = myAt[0];</div>
<div class="line"><a name="l09327"></a><span class="lineno"> 9327</span>&#160;                }</div>
<div class="line"><a name="l09328"></a><span class="lineno"> 9328</span>&#160;</div>
<div class="line"><a name="l09329"></a><span class="lineno"> 9329</span>&#160;                $.each([<span class="stringliteral">&#39;left&#39;</span>, <span class="stringliteral">&#39;top&#39;</span>], <span class="keyword">function</span>(i, offsetPosition) {</div>
<div class="line"><a name="l09330"></a><span class="lineno"> 9330</span>&#160;                    <span class="keywordflow">if</span> (+myAt[i] === myAt[i]) {</div>
<div class="line"><a name="l09331"></a><span class="lineno"> 9331</span>&#160;                        offset[i] = myAt[i];</div>
<div class="line"><a name="l09332"></a><span class="lineno"> 9332</span>&#160;                        myAt[i] = offsetPosition;</div>
<div class="line"><a name="l09333"></a><span class="lineno"> 9333</span>&#160;                    }</div>
<div class="line"><a name="l09334"></a><span class="lineno"> 9334</span>&#160;                });</div>
<div class="line"><a name="l09335"></a><span class="lineno"> 9335</span>&#160;</div>
<div class="line"><a name="l09336"></a><span class="lineno"> 9336</span>&#160;                position = {</div>
<div class="line"><a name="l09337"></a><span class="lineno"> 9337</span>&#160;                    my: myAt.join(<span class="stringliteral">&quot; &quot;</span>),</div>
<div class="line"><a name="l09338"></a><span class="lineno"> 9338</span>&#160;                    at: myAt.join(<span class="stringliteral">&quot; &quot;</span>),</div>
<div class="line"><a name="l09339"></a><span class="lineno"> 9339</span>&#160;                    offset: offset.join(<span class="stringliteral">&quot; &quot;</span>)</div>
<div class="line"><a name="l09340"></a><span class="lineno"> 9340</span>&#160;                };</div>
<div class="line"><a name="l09341"></a><span class="lineno"> 9341</span>&#160;            } </div>
<div class="line"><a name="l09342"></a><span class="lineno"> 9342</span>&#160;</div>
<div class="line"><a name="l09343"></a><span class="lineno"> 9343</span>&#160;            position = $.extend({}, $.ui.dialog.prototype.options.position, position);</div>
<div class="line"><a name="l09344"></a><span class="lineno"> 9344</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09345"></a><span class="lineno"> 9345</span>&#160;            position = $.ui.dialog.prototype.options.position;</div>
<div class="line"><a name="l09346"></a><span class="lineno"> 9346</span>&#160;        }</div>
<div class="line"><a name="l09347"></a><span class="lineno"> 9347</span>&#160;</div>
<div class="line"><a name="l09348"></a><span class="lineno"> 9348</span>&#160;        <span class="comment">// need to show the dialog to get the actual offset in the position plugin</span></div>
<div class="line"><a name="l09349"></a><span class="lineno"> 9349</span>&#160;        isVisible = this.uiDialog.is(<span class="stringliteral">&#39;:visible&#39;</span>);</div>
<div class="line"><a name="l09350"></a><span class="lineno"> 9350</span>&#160;        <span class="keywordflow">if</span> (!isVisible) {</div>
<div class="line"><a name="l09351"></a><span class="lineno"> 9351</span>&#160;            this.uiDialog.show();</div>
<div class="line"><a name="l09352"></a><span class="lineno"> 9352</span>&#160;        }</div>
<div class="line"><a name="l09353"></a><span class="lineno"> 9353</span>&#160;        this.uiDialog</div>
<div class="line"><a name="l09354"></a><span class="lineno"> 9354</span>&#160;            <span class="comment">// workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781</span></div>
<div class="line"><a name="l09355"></a><span class="lineno"> 9355</span>&#160;            .css({ top: 0, left: 0 })</div>
<div class="line"><a name="l09356"></a><span class="lineno"> 9356</span>&#160;            .position($.extend({ of: window }, position));</div>
<div class="line"><a name="l09357"></a><span class="lineno"> 9357</span>&#160;        <span class="keywordflow">if</span> (!isVisible) {</div>
<div class="line"><a name="l09358"></a><span class="lineno"> 9358</span>&#160;            this.uiDialog.hide();</div>
<div class="line"><a name="l09359"></a><span class="lineno"> 9359</span>&#160;        }</div>
<div class="line"><a name="l09360"></a><span class="lineno"> 9360</span>&#160;    },</div>
<div class="line"><a name="l09361"></a><span class="lineno"> 9361</span>&#160;</div>
<div class="line"><a name="l09362"></a><span class="lineno"> 9362</span>&#160;    _setOptions: <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l09363"></a><span class="lineno"> 9363</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09364"></a><span class="lineno"> 9364</span>&#160;            resizableOptions = {},</div>
<div class="line"><a name="l09365"></a><span class="lineno"> 9365</span>&#160;            resize = <span class="keyword">false</span>;</div>
<div class="line"><a name="l09366"></a><span class="lineno"> 9366</span>&#160;</div>
<div class="line"><a name="l09367"></a><span class="lineno"> 9367</span>&#160;        $.each( options, <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l09368"></a><span class="lineno"> 9368</span>&#160;            <span class="keyword">self</span>._setOption( key, value );</div>
<div class="line"><a name="l09369"></a><span class="lineno"> 9369</span>&#160;            </div>
<div class="line"><a name="l09370"></a><span class="lineno"> 9370</span>&#160;            <span class="keywordflow">if</span> ( key in sizeRelatedOptions ) {</div>
<div class="line"><a name="l09371"></a><span class="lineno"> 9371</span>&#160;                resize = <span class="keyword">true</span>;</div>
<div class="line"><a name="l09372"></a><span class="lineno"> 9372</span>&#160;            }</div>
<div class="line"><a name="l09373"></a><span class="lineno"> 9373</span>&#160;            <span class="keywordflow">if</span> ( key in resizableRelatedOptions ) {</div>
<div class="line"><a name="l09374"></a><span class="lineno"> 9374</span>&#160;                resizableOptions[ key ] = value;</div>
<div class="line"><a name="l09375"></a><span class="lineno"> 9375</span>&#160;            }</div>
<div class="line"><a name="l09376"></a><span class="lineno"> 9376</span>&#160;        });</div>
<div class="line"><a name="l09377"></a><span class="lineno"> 9377</span>&#160;</div>
<div class="line"><a name="l09378"></a><span class="lineno"> 9378</span>&#160;        <span class="keywordflow">if</span> ( resize ) {</div>
<div class="line"><a name="l09379"></a><span class="lineno"> 9379</span>&#160;            this._size();</div>
<div class="line"><a name="l09380"></a><span class="lineno"> 9380</span>&#160;        }</div>
<div class="line"><a name="l09381"></a><span class="lineno"> 9381</span>&#160;        <span class="keywordflow">if</span> ( this.uiDialog.is( <span class="stringliteral">&quot;:data(resizable)&quot;</span> ) ) {</div>
<div class="line"><a name="l09382"></a><span class="lineno"> 9382</span>&#160;            this.uiDialog.resizable( <span class="stringliteral">&quot;option&quot;</span>, resizableOptions );</div>
<div class="line"><a name="l09383"></a><span class="lineno"> 9383</span>&#160;        }</div>
<div class="line"><a name="l09384"></a><span class="lineno"> 9384</span>&#160;    },</div>
<div class="line"><a name="l09385"></a><span class="lineno"> 9385</span>&#160;</div>
<div class="line"><a name="l09386"></a><span class="lineno"> 9386</span>&#160;    _setOption: <span class="keyword">function</span>(key, value){</div>
<div class="line"><a name="l09387"></a><span class="lineno"> 9387</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l09388"></a><span class="lineno"> 9388</span>&#160;            uiDialog = <span class="keyword">self</span>.uiDialog;</div>
<div class="line"><a name="l09389"></a><span class="lineno"> 9389</span>&#160;</div>
<div class="line"><a name="l09390"></a><span class="lineno"> 9390</span>&#160;        <span class="keywordflow">switch</span> (key) {</div>
<div class="line"><a name="l09391"></a><span class="lineno"> 9391</span>&#160;            <span class="comment">//handling of deprecated beforeclose (vs beforeClose) option</span></div>
<div class="line"><a name="l09392"></a><span class="lineno"> 9392</span>&#160;            <span class="comment">//Ticket #4669 http://dev.jqueryui.com/ticket/4669</span></div>
<div class="line"><a name="l09393"></a><span class="lineno"> 9393</span>&#160;            <span class="comment">//TODO: remove in 1.9pre</span></div>
<div class="line"><a name="l09394"></a><span class="lineno"> 9394</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;beforeclose&quot;</span>:</div>
<div class="line"><a name="l09395"></a><span class="lineno"> 9395</span>&#160;                key = <span class="stringliteral">&quot;beforeClose&quot;</span>;</div>
<div class="line"><a name="l09396"></a><span class="lineno"> 9396</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09397"></a><span class="lineno"> 9397</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;buttons&quot;</span>:</div>
<div class="line"><a name="l09398"></a><span class="lineno"> 9398</span>&#160;                <span class="keyword">self</span>._createButtons(value);</div>
<div class="line"><a name="l09399"></a><span class="lineno"> 9399</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09400"></a><span class="lineno"> 9400</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;closeText&quot;</span>:</div>
<div class="line"><a name="l09401"></a><span class="lineno"> 9401</span>&#160;                <span class="comment">// ensure that we always pass a string</span></div>
<div class="line"><a name="l09402"></a><span class="lineno"> 9402</span>&#160;                <span class="keyword">self</span>.uiDialogTitlebarCloseText.text(<span class="stringliteral">&quot;&quot;</span> + value);</div>
<div class="line"><a name="l09403"></a><span class="lineno"> 9403</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09404"></a><span class="lineno"> 9404</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;dialogClass&quot;</span>:</div>
<div class="line"><a name="l09405"></a><span class="lineno"> 9405</span>&#160;                uiDialog</div>
<div class="line"><a name="l09406"></a><span class="lineno"> 9406</span>&#160;                    .removeClass(<span class="keyword">self</span>.options.dialogClass)</div>
<div class="line"><a name="l09407"></a><span class="lineno"> 9407</span>&#160;                    .addClass(uiDialogClasses + value);</div>
<div class="line"><a name="l09408"></a><span class="lineno"> 9408</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09409"></a><span class="lineno"> 9409</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;disabled&quot;</span>:</div>
<div class="line"><a name="l09410"></a><span class="lineno"> 9410</span>&#160;                <span class="keywordflow">if</span> (value) {</div>
<div class="line"><a name="l09411"></a><span class="lineno"> 9411</span>&#160;                    uiDialog.addClass(<span class="stringliteral">&#39;ui-dialog-disabled&#39;</span>);</div>
<div class="line"><a name="l09412"></a><span class="lineno"> 9412</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09413"></a><span class="lineno"> 9413</span>&#160;                    uiDialog.removeClass(<span class="stringliteral">&#39;ui-dialog-disabled&#39;</span>);</div>
<div class="line"><a name="l09414"></a><span class="lineno"> 9414</span>&#160;                }</div>
<div class="line"><a name="l09415"></a><span class="lineno"> 9415</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09416"></a><span class="lineno"> 9416</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;draggable&quot;</span>:</div>
<div class="line"><a name="l09417"></a><span class="lineno"> 9417</span>&#160;                var isDraggable = uiDialog.is( <span class="stringliteral">&quot;:data(draggable)&quot;</span> );</div>
<div class="line"><a name="l09418"></a><span class="lineno"> 9418</span>&#160;                <span class="keywordflow">if</span> ( isDraggable &amp;&amp; !value ) {</div>
<div class="line"><a name="l09419"></a><span class="lineno"> 9419</span>&#160;                    uiDialog.draggable( <span class="stringliteral">&quot;destroy&quot;</span> );</div>
<div class="line"><a name="l09420"></a><span class="lineno"> 9420</span>&#160;                }</div>
<div class="line"><a name="l09421"></a><span class="lineno"> 9421</span>&#160;                </div>
<div class="line"><a name="l09422"></a><span class="lineno"> 9422</span>&#160;                <span class="keywordflow">if</span> ( !isDraggable &amp;&amp; value ) {</div>
<div class="line"><a name="l09423"></a><span class="lineno"> 9423</span>&#160;                    <span class="keyword">self</span>._makeDraggable();</div>
<div class="line"><a name="l09424"></a><span class="lineno"> 9424</span>&#160;                }</div>
<div class="line"><a name="l09425"></a><span class="lineno"> 9425</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09426"></a><span class="lineno"> 9426</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;position&quot;</span>:</div>
<div class="line"><a name="l09427"></a><span class="lineno"> 9427</span>&#160;                <span class="keyword">self</span>._position(value);</div>
<div class="line"><a name="l09428"></a><span class="lineno"> 9428</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09429"></a><span class="lineno"> 9429</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;resizable&quot;</span>:</div>
<div class="line"><a name="l09430"></a><span class="lineno"> 9430</span>&#160;                <span class="comment">// currently resizable, becoming non-resizable</span></div>
<div class="line"><a name="l09431"></a><span class="lineno"> 9431</span>&#160;                var isResizable = uiDialog.is( <span class="stringliteral">&quot;:data(resizable)&quot;</span> );</div>
<div class="line"><a name="l09432"></a><span class="lineno"> 9432</span>&#160;                <span class="keywordflow">if</span> (isResizable &amp;&amp; !value) {</div>
<div class="line"><a name="l09433"></a><span class="lineno"> 9433</span>&#160;                    uiDialog.resizable(<span class="stringliteral">&#39;destroy&#39;</span>);</div>
<div class="line"><a name="l09434"></a><span class="lineno"> 9434</span>&#160;                }</div>
<div class="line"><a name="l09435"></a><span class="lineno"> 9435</span>&#160;</div>
<div class="line"><a name="l09436"></a><span class="lineno"> 9436</span>&#160;                <span class="comment">// currently resizable, changing handles</span></div>
<div class="line"><a name="l09437"></a><span class="lineno"> 9437</span>&#160;                <span class="keywordflow">if</span> (isResizable &amp;&amp; typeof value === <span class="stringliteral">&#39;string&#39;</span>) {</div>
<div class="line"><a name="l09438"></a><span class="lineno"> 9438</span>&#160;                    uiDialog.resizable(<span class="stringliteral">&#39;option&#39;</span>, <span class="stringliteral">&#39;handles&#39;</span>, value);</div>
<div class="line"><a name="l09439"></a><span class="lineno"> 9439</span>&#160;                }</div>
<div class="line"><a name="l09440"></a><span class="lineno"> 9440</span>&#160;</div>
<div class="line"><a name="l09441"></a><span class="lineno"> 9441</span>&#160;                <span class="comment">// currently non-resizable, becoming resizable</span></div>
<div class="line"><a name="l09442"></a><span class="lineno"> 9442</span>&#160;                <span class="keywordflow">if</span> (!isResizable &amp;&amp; value !== <span class="keyword">false</span>) {</div>
<div class="line"><a name="l09443"></a><span class="lineno"> 9443</span>&#160;                    <span class="keyword">self</span>._makeResizable(value);</div>
<div class="line"><a name="l09444"></a><span class="lineno"> 9444</span>&#160;                }</div>
<div class="line"><a name="l09445"></a><span class="lineno"> 9445</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09446"></a><span class="lineno"> 9446</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;title&quot;</span>:</div>
<div class="line"><a name="l09447"></a><span class="lineno"> 9447</span>&#160;                <span class="comment">// convert whatever was passed in o a string, for html() to not throw up</span></div>
<div class="line"><a name="l09448"></a><span class="lineno"> 9448</span>&#160;                $(<span class="stringliteral">&quot;.ui-dialog-title&quot;</span>, <span class="keyword">self</span>.uiDialogTitlebar).html(<span class="stringliteral">&quot;&quot;</span> + (value || <span class="stringliteral">&#39;&amp;#160;&#39;</span>));</div>
<div class="line"><a name="l09449"></a><span class="lineno"> 9449</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l09450"></a><span class="lineno"> 9450</span>&#160;        }</div>
<div class="line"><a name="l09451"></a><span class="lineno"> 9451</span>&#160;</div>
<div class="line"><a name="l09452"></a><span class="lineno"> 9452</span>&#160;        $.Widget.prototype._setOption.apply(<span class="keyword">self</span>, arguments);</div>
<div class="line"><a name="l09453"></a><span class="lineno"> 9453</span>&#160;    },</div>
<div class="line"><a name="l09454"></a><span class="lineno"> 9454</span>&#160;</div>
<div class="line"><a name="l09455"></a><span class="lineno"> 9455</span>&#160;    _size: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09456"></a><span class="lineno"> 9456</span>&#160;        <span class="comment">/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content</span></div>
<div class="line"><a name="l09457"></a><span class="lineno"> 9457</span>&#160;<span class="comment">         * divs will both have width and height set, so we need to reset them</span></div>
<div class="line"><a name="l09458"></a><span class="lineno"> 9458</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l09459"></a><span class="lineno"> 9459</span>&#160;        var options = this.options,</div>
<div class="line"><a name="l09460"></a><span class="lineno"> 9460</span>&#160;            nonContentHeight,</div>
<div class="line"><a name="l09461"></a><span class="lineno"> 9461</span>&#160;            minContentHeight,</div>
<div class="line"><a name="l09462"></a><span class="lineno"> 9462</span>&#160;            isVisible = this.uiDialog.is( <span class="stringliteral">&quot;:visible&quot;</span> );</div>
<div class="line"><a name="l09463"></a><span class="lineno"> 9463</span>&#160;</div>
<div class="line"><a name="l09464"></a><span class="lineno"> 9464</span>&#160;        <span class="comment">// reset content sizing</span></div>
<div class="line"><a name="l09465"></a><span class="lineno"> 9465</span>&#160;        this.element.show().css({</div>
<div class="line"><a name="l09466"></a><span class="lineno"> 9466</span>&#160;            width: <span class="stringliteral">&#39;auto&#39;</span>,</div>
<div class="line"><a name="l09467"></a><span class="lineno"> 9467</span>&#160;            minHeight: 0,</div>
<div class="line"><a name="l09468"></a><span class="lineno"> 9468</span>&#160;            height: 0</div>
<div class="line"><a name="l09469"></a><span class="lineno"> 9469</span>&#160;        });</div>
<div class="line"><a name="l09470"></a><span class="lineno"> 9470</span>&#160;</div>
<div class="line"><a name="l09471"></a><span class="lineno"> 9471</span>&#160;        <span class="keywordflow">if</span> (options.minWidth &gt; options.width) {</div>
<div class="line"><a name="l09472"></a><span class="lineno"> 9472</span>&#160;            options.width = options.minWidth;</div>
<div class="line"><a name="l09473"></a><span class="lineno"> 9473</span>&#160;        }</div>
<div class="line"><a name="l09474"></a><span class="lineno"> 9474</span>&#160;</div>
<div class="line"><a name="l09475"></a><span class="lineno"> 9475</span>&#160;        <span class="comment">// reset wrapper sizing</span></div>
<div class="line"><a name="l09476"></a><span class="lineno"> 9476</span>&#160;        <span class="comment">// determine the height of all the non-content elements</span></div>
<div class="line"><a name="l09477"></a><span class="lineno"> 9477</span>&#160;        nonContentHeight = this.uiDialog.css({</div>
<div class="line"><a name="l09478"></a><span class="lineno"> 9478</span>&#160;                height: <span class="stringliteral">&#39;auto&#39;</span>,</div>
<div class="line"><a name="l09479"></a><span class="lineno"> 9479</span>&#160;                width: options.width</div>
<div class="line"><a name="l09480"></a><span class="lineno"> 9480</span>&#160;            })</div>
<div class="line"><a name="l09481"></a><span class="lineno"> 9481</span>&#160;            .height();</div>
<div class="line"><a name="l09482"></a><span class="lineno"> 9482</span>&#160;        minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );</div>
<div class="line"><a name="l09483"></a><span class="lineno"> 9483</span>&#160;        </div>
<div class="line"><a name="l09484"></a><span class="lineno"> 9484</span>&#160;        <span class="keywordflow">if</span> ( options.height === <span class="stringliteral">&quot;auto&quot;</span> ) {</div>
<div class="line"><a name="l09485"></a><span class="lineno"> 9485</span>&#160;            <span class="comment">// only needed for IE6 support</span></div>
<div class="line"><a name="l09486"></a><span class="lineno"> 9486</span>&#160;            <span class="keywordflow">if</span> ( $.support.minHeight ) {</div>
<div class="line"><a name="l09487"></a><span class="lineno"> 9487</span>&#160;                this.element.css({</div>
<div class="line"><a name="l09488"></a><span class="lineno"> 9488</span>&#160;                    minHeight: minContentHeight,</div>
<div class="line"><a name="l09489"></a><span class="lineno"> 9489</span>&#160;                    height: <span class="stringliteral">&quot;auto&quot;</span></div>
<div class="line"><a name="l09490"></a><span class="lineno"> 9490</span>&#160;                });</div>
<div class="line"><a name="l09491"></a><span class="lineno"> 9491</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09492"></a><span class="lineno"> 9492</span>&#160;                this.uiDialog.show();</div>
<div class="line"><a name="l09493"></a><span class="lineno"> 9493</span>&#160;                var autoHeight = this.element.css( <span class="stringliteral">&quot;height&quot;</span>, <span class="stringliteral">&quot;auto&quot;</span> ).height();</div>
<div class="line"><a name="l09494"></a><span class="lineno"> 9494</span>&#160;                <span class="keywordflow">if</span> ( !isVisible ) {</div>
<div class="line"><a name="l09495"></a><span class="lineno"> 9495</span>&#160;                    this.uiDialog.hide();</div>
<div class="line"><a name="l09496"></a><span class="lineno"> 9496</span>&#160;                }</div>
<div class="line"><a name="l09497"></a><span class="lineno"> 9497</span>&#160;                this.element.height( Math.max( autoHeight, minContentHeight ) );</div>
<div class="line"><a name="l09498"></a><span class="lineno"> 9498</span>&#160;            }</div>
<div class="line"><a name="l09499"></a><span class="lineno"> 9499</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09500"></a><span class="lineno"> 9500</span>&#160;            this.element.height( Math.max( options.height - nonContentHeight, 0 ) );</div>
<div class="line"><a name="l09501"></a><span class="lineno"> 9501</span>&#160;        }</div>
<div class="line"><a name="l09502"></a><span class="lineno"> 9502</span>&#160;</div>
<div class="line"><a name="l09503"></a><span class="lineno"> 9503</span>&#160;        <span class="keywordflow">if</span> (this.uiDialog.is(<span class="stringliteral">&#39;:data(resizable)&#39;</span>)) {</div>
<div class="line"><a name="l09504"></a><span class="lineno"> 9504</span>&#160;            this.uiDialog.resizable(<span class="stringliteral">&#39;option&#39;</span>, <span class="stringliteral">&#39;minHeight&#39;</span>, this._minHeight());</div>
<div class="line"><a name="l09505"></a><span class="lineno"> 9505</span>&#160;        }</div>
<div class="line"><a name="l09506"></a><span class="lineno"> 9506</span>&#160;    }</div>
<div class="line"><a name="l09507"></a><span class="lineno"> 9507</span>&#160;});</div>
<div class="line"><a name="l09508"></a><span class="lineno"> 9508</span>&#160;</div>
<div class="line"><a name="l09509"></a><span class="lineno"> 9509</span>&#160;$.extend($.ui.dialog, {</div>
<div class="line"><a name="l09510"></a><span class="lineno"> 9510</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span>,</div>
<div class="line"><a name="l09511"></a><span class="lineno"> 9511</span>&#160;</div>
<div class="line"><a name="l09512"></a><span class="lineno"> 9512</span>&#160;    uuid: 0,</div>
<div class="line"><a name="l09513"></a><span class="lineno"> 9513</span>&#160;    maxZ: 0,</div>
<div class="line"><a name="l09514"></a><span class="lineno"> 9514</span>&#160;</div>
<div class="line"><a name="l09515"></a><span class="lineno"> 9515</span>&#160;    getTitleId: <span class="keyword">function</span>($el) {</div>
<div class="line"><a name="l09516"></a><span class="lineno"> 9516</span>&#160;        var <span class="keywordtype">id</span> = $el.attr(<span class="stringliteral">&#39;id&#39;</span>);</div>
<div class="line"><a name="l09517"></a><span class="lineno"> 9517</span>&#160;        <span class="keywordflow">if</span> (!<span class="keywordtype">id</span>) {</div>
<div class="line"><a name="l09518"></a><span class="lineno"> 9518</span>&#160;            this.uuid += 1;</div>
<div class="line"><a name="l09519"></a><span class="lineno"> 9519</span>&#160;            <span class="keywordtype">id</span> = this.uuid;</div>
<div class="line"><a name="l09520"></a><span class="lineno"> 9520</span>&#160;        }</div>
<div class="line"><a name="l09521"></a><span class="lineno"> 9521</span>&#160;        <span class="keywordflow">return</span> <span class="stringliteral">&#39;ui-dialog-title-&#39;</span> + id;</div>
<div class="line"><a name="l09522"></a><span class="lineno"> 9522</span>&#160;    },</div>
<div class="line"><a name="l09523"></a><span class="lineno"> 9523</span>&#160;</div>
<div class="line"><a name="l09524"></a><span class="lineno"> 9524</span>&#160;    overlay: <span class="keyword">function</span>(dialog) {</div>
<div class="line"><a name="l09525"></a><span class="lineno"> 9525</span>&#160;        this.$el = $.ui.dialog.overlay.create(dialog);</div>
<div class="line"><a name="l09526"></a><span class="lineno"> 9526</span>&#160;    }</div>
<div class="line"><a name="l09527"></a><span class="lineno"> 9527</span>&#160;});</div>
<div class="line"><a name="l09528"></a><span class="lineno"> 9528</span>&#160;</div>
<div class="line"><a name="l09529"></a><span class="lineno"> 9529</span>&#160;$.extend($.ui.dialog.overlay, {</div>
<div class="line"><a name="l09530"></a><span class="lineno"> 9530</span>&#160;    instances: [],</div>
<div class="line"><a name="l09531"></a><span class="lineno"> 9531</span>&#160;    <span class="comment">// reuse old instances due to IE memory leak with alpha transparency (see #5185)</span></div>
<div class="line"><a name="l09532"></a><span class="lineno"> 9532</span>&#160;    oldInstances: [],</div>
<div class="line"><a name="l09533"></a><span class="lineno"> 9533</span>&#160;    maxZ: 0,</div>
<div class="line"><a name="l09534"></a><span class="lineno"> 9534</span>&#160;    events: $.map(<span class="stringliteral">&#39;focus,mousedown,mouseup,keydown,keypress,click&#39;</span>.split(<span class="charliteral">&#39;,&#39;</span>),</div>
<div class="line"><a name="l09535"></a><span class="lineno"> 9535</span>&#160;        <span class="keyword">function</span>(event) { <span class="keywordflow">return</span> <span class="keyword">event</span> + <span class="stringliteral">&#39;.dialog-overlay&#39;</span>; }).join(<span class="charliteral">&#39; &#39;</span>),</div>
<div class="line"><a name="l09536"></a><span class="lineno"> 9536</span>&#160;    create: <span class="keyword">function</span>(dialog) {</div>
<div class="line"><a name="l09537"></a><span class="lineno"> 9537</span>&#160;        <span class="keywordflow">if</span> (this.instances.length === 0) {</div>
<div class="line"><a name="l09538"></a><span class="lineno"> 9538</span>&#160;            <span class="comment">// prevent use of anchors and inputs</span></div>
<div class="line"><a name="l09539"></a><span class="lineno"> 9539</span>&#160;            <span class="comment">// we use a setTimeout in case the overlay is created from an</span></div>
<div class="line"><a name="l09540"></a><span class="lineno"> 9540</span>&#160;            <span class="comment">// event that we&#39;re going to be cancelling (see #2804)</span></div>
<div class="line"><a name="l09541"></a><span class="lineno"> 9541</span>&#160;            setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l09542"></a><span class="lineno"> 9542</span>&#160;                <span class="comment">// handle $(el).dialog().dialog(&#39;close&#39;) (see #4065)</span></div>
<div class="line"><a name="l09543"></a><span class="lineno"> 9543</span>&#160;                <span class="keywordflow">if</span> ($.ui.dialog.overlay.instances.length) {</div>
<div class="line"><a name="l09544"></a><span class="lineno"> 9544</span>&#160;                    $(document).bind($.ui.dialog.overlay.events, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l09545"></a><span class="lineno"> 9545</span>&#160;                        <span class="comment">// stop events if the z-index of the target is &lt; the z-index of the overlay</span></div>
<div class="line"><a name="l09546"></a><span class="lineno"> 9546</span>&#160;                        <span class="comment">// we cannot return true when we don&#39;t want to cancel the event (#3523)</span></div>
<div class="line"><a name="l09547"></a><span class="lineno"> 9547</span>&#160;                        if ($(event.target).zIndex() &lt; $.ui.dialog.overlay.maxZ) {</div>
<div class="line"><a name="l09548"></a><span class="lineno"> 9548</span>&#160;                            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l09549"></a><span class="lineno"> 9549</span>&#160;                        }</div>
<div class="line"><a name="l09550"></a><span class="lineno"> 9550</span>&#160;                    });</div>
<div class="line"><a name="l09551"></a><span class="lineno"> 9551</span>&#160;                }</div>
<div class="line"><a name="l09552"></a><span class="lineno"> 9552</span>&#160;            }, 1);</div>
<div class="line"><a name="l09553"></a><span class="lineno"> 9553</span>&#160;</div>
<div class="line"><a name="l09554"></a><span class="lineno"> 9554</span>&#160;            <span class="comment">// allow closing by pressing the escape key</span></div>
<div class="line"><a name="l09555"></a><span class="lineno"> 9555</span>&#160;            $(document).bind(<span class="stringliteral">&#39;keydown.dialog-overlay&#39;</span>, <span class="keyword">function</span>(event) {</div>
<div class="line"><a name="l09556"></a><span class="lineno"> 9556</span>&#160;                <span class="keywordflow">if</span> (dialog.options.closeOnEscape &amp;&amp; !event.isDefaultPrevented() &amp;&amp; <span class="keyword">event</span>.keyCode &amp;&amp;</div>
<div class="line"><a name="l09557"></a><span class="lineno"> 9557</span>&#160;                    <span class="keyword">event</span>.keyCode === $.ui.keyCode.ESCAPE) {</div>
<div class="line"><a name="l09558"></a><span class="lineno"> 9558</span>&#160;                    </div>
<div class="line"><a name="l09559"></a><span class="lineno"> 9559</span>&#160;                    dialog.close(event);</div>
<div class="line"><a name="l09560"></a><span class="lineno"> 9560</span>&#160;                    <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l09561"></a><span class="lineno"> 9561</span>&#160;                }</div>
<div class="line"><a name="l09562"></a><span class="lineno"> 9562</span>&#160;            });</div>
<div class="line"><a name="l09563"></a><span class="lineno"> 9563</span>&#160;</div>
<div class="line"><a name="l09564"></a><span class="lineno"> 9564</span>&#160;            <span class="comment">// handle window resize</span></div>
<div class="line"><a name="l09565"></a><span class="lineno"> 9565</span>&#160;            $(window).bind(<span class="stringliteral">&#39;resize.dialog-overlay&#39;</span>, $.ui.dialog.overlay.resize);</div>
<div class="line"><a name="l09566"></a><span class="lineno"> 9566</span>&#160;        }</div>
<div class="line"><a name="l09567"></a><span class="lineno"> 9567</span>&#160;</div>
<div class="line"><a name="l09568"></a><span class="lineno"> 9568</span>&#160;        var $el = (this.oldInstances.pop() || $(<span class="stringliteral">&#39;&lt;div&gt;&lt;/div&gt;&#39;</span>).addClass(<span class="stringliteral">&#39;ui-widget-overlay&#39;</span>))</div>
<div class="line"><a name="l09569"></a><span class="lineno"> 9569</span>&#160;            .appendTo(document.body)</div>
<div class="line"><a name="l09570"></a><span class="lineno"> 9570</span>&#160;            .css({</div>
<div class="line"><a name="l09571"></a><span class="lineno"> 9571</span>&#160;                width: this.width(),</div>
<div class="line"><a name="l09572"></a><span class="lineno"> 9572</span>&#160;                height: this.height()</div>
<div class="line"><a name="l09573"></a><span class="lineno"> 9573</span>&#160;            });</div>
<div class="line"><a name="l09574"></a><span class="lineno"> 9574</span>&#160;</div>
<div class="line"><a name="l09575"></a><span class="lineno"> 9575</span>&#160;        <span class="keywordflow">if</span> ($.fn.bgiframe) {</div>
<div class="line"><a name="l09576"></a><span class="lineno"> 9576</span>&#160;            $el.bgiframe();</div>
<div class="line"><a name="l09577"></a><span class="lineno"> 9577</span>&#160;        }</div>
<div class="line"><a name="l09578"></a><span class="lineno"> 9578</span>&#160;</div>
<div class="line"><a name="l09579"></a><span class="lineno"> 9579</span>&#160;        this.instances.push($el);</div>
<div class="line"><a name="l09580"></a><span class="lineno"> 9580</span>&#160;        <span class="keywordflow">return</span> $el;</div>
<div class="line"><a name="l09581"></a><span class="lineno"> 9581</span>&#160;    },</div>
<div class="line"><a name="l09582"></a><span class="lineno"> 9582</span>&#160;</div>
<div class="line"><a name="l09583"></a><span class="lineno"> 9583</span>&#160;    destroy: <span class="keyword">function</span>($el) {</div>
<div class="line"><a name="l09584"></a><span class="lineno"> 9584</span>&#160;        var indexOf = $.inArray($el, this.instances);</div>
<div class="line"><a name="l09585"></a><span class="lineno"> 9585</span>&#160;        <span class="keywordflow">if</span> (indexOf != -1){</div>
<div class="line"><a name="l09586"></a><span class="lineno"> 9586</span>&#160;            this.oldInstances.push(this.instances.splice(indexOf, 1)[0]);</div>
<div class="line"><a name="l09587"></a><span class="lineno"> 9587</span>&#160;        }</div>
<div class="line"><a name="l09588"></a><span class="lineno"> 9588</span>&#160;</div>
<div class="line"><a name="l09589"></a><span class="lineno"> 9589</span>&#160;        <span class="keywordflow">if</span> (this.instances.length === 0) {</div>
<div class="line"><a name="l09590"></a><span class="lineno"> 9590</span>&#160;            $([document, window]).unbind(<span class="stringliteral">&#39;.dialog-overlay&#39;</span>);</div>
<div class="line"><a name="l09591"></a><span class="lineno"> 9591</span>&#160;        }</div>
<div class="line"><a name="l09592"></a><span class="lineno"> 9592</span>&#160;</div>
<div class="line"><a name="l09593"></a><span class="lineno"> 9593</span>&#160;        $el.remove();</div>
<div class="line"><a name="l09594"></a><span class="lineno"> 9594</span>&#160;        </div>
<div class="line"><a name="l09595"></a><span class="lineno"> 9595</span>&#160;        <span class="comment">// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)</span></div>
<div class="line"><a name="l09596"></a><span class="lineno"> 9596</span>&#160;        var maxZ = 0;</div>
<div class="line"><a name="l09597"></a><span class="lineno"> 9597</span>&#160;        $.each(this.instances, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09598"></a><span class="lineno"> 9598</span>&#160;            maxZ = Math.max(maxZ, this.css(<span class="stringliteral">&#39;z-index&#39;</span>));</div>
<div class="line"><a name="l09599"></a><span class="lineno"> 9599</span>&#160;        });</div>
<div class="line"><a name="l09600"></a><span class="lineno"> 9600</span>&#160;        this.maxZ = maxZ;</div>
<div class="line"><a name="l09601"></a><span class="lineno"> 9601</span>&#160;    },</div>
<div class="line"><a name="l09602"></a><span class="lineno"> 9602</span>&#160;</div>
<div class="line"><a name="l09603"></a><span class="lineno"> 9603</span>&#160;    height: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09604"></a><span class="lineno"> 9604</span>&#160;        var scrollHeight,</div>
<div class="line"><a name="l09605"></a><span class="lineno"> 9605</span>&#160;            offsetHeight;</div>
<div class="line"><a name="l09606"></a><span class="lineno"> 9606</span>&#160;        <span class="comment">// handle IE 6</span></div>
<div class="line"><a name="l09607"></a><span class="lineno"> 9607</span>&#160;        <span class="keywordflow">if</span> ($.browser.msie &amp;&amp; $.browser.version &lt; 7) {</div>
<div class="line"><a name="l09608"></a><span class="lineno"> 9608</span>&#160;            scrollHeight = Math.max(</div>
<div class="line"><a name="l09609"></a><span class="lineno"> 9609</span>&#160;                document.documentElement.scrollHeight,</div>
<div class="line"><a name="l09610"></a><span class="lineno"> 9610</span>&#160;                document.body.scrollHeight</div>
<div class="line"><a name="l09611"></a><span class="lineno"> 9611</span>&#160;            );</div>
<div class="line"><a name="l09612"></a><span class="lineno"> 9612</span>&#160;            offsetHeight = Math.max(</div>
<div class="line"><a name="l09613"></a><span class="lineno"> 9613</span>&#160;                document.documentElement.offsetHeight,</div>
<div class="line"><a name="l09614"></a><span class="lineno"> 9614</span>&#160;                document.body.offsetHeight</div>
<div class="line"><a name="l09615"></a><span class="lineno"> 9615</span>&#160;            );</div>
<div class="line"><a name="l09616"></a><span class="lineno"> 9616</span>&#160;</div>
<div class="line"><a name="l09617"></a><span class="lineno"> 9617</span>&#160;            <span class="keywordflow">if</span> (scrollHeight &lt; offsetHeight) {</div>
<div class="line"><a name="l09618"></a><span class="lineno"> 9618</span>&#160;                <span class="keywordflow">return</span> $(window).height() + <span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l09619"></a><span class="lineno"> 9619</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09620"></a><span class="lineno"> 9620</span>&#160;                <span class="keywordflow">return</span> scrollHeight + <span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l09621"></a><span class="lineno"> 9621</span>&#160;            }</div>
<div class="line"><a name="l09622"></a><span class="lineno"> 9622</span>&#160;        <span class="comment">// handle &quot;good&quot; browsers</span></div>
<div class="line"><a name="l09623"></a><span class="lineno"> 9623</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09624"></a><span class="lineno"> 9624</span>&#160;            <span class="keywordflow">return</span> $(document).height() + <span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l09625"></a><span class="lineno"> 9625</span>&#160;        }</div>
<div class="line"><a name="l09626"></a><span class="lineno"> 9626</span>&#160;    },</div>
<div class="line"><a name="l09627"></a><span class="lineno"> 9627</span>&#160;</div>
<div class="line"><a name="l09628"></a><span class="lineno"> 9628</span>&#160;    width: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09629"></a><span class="lineno"> 9629</span>&#160;        var scrollWidth,</div>
<div class="line"><a name="l09630"></a><span class="lineno"> 9630</span>&#160;            offsetWidth;</div>
<div class="line"><a name="l09631"></a><span class="lineno"> 9631</span>&#160;        <span class="comment">// handle IE</span></div>
<div class="line"><a name="l09632"></a><span class="lineno"> 9632</span>&#160;        <span class="keywordflow">if</span> ( $.browser.msie ) {</div>
<div class="line"><a name="l09633"></a><span class="lineno"> 9633</span>&#160;            scrollWidth = Math.max(</div>
<div class="line"><a name="l09634"></a><span class="lineno"> 9634</span>&#160;                document.documentElement.scrollWidth,</div>
<div class="line"><a name="l09635"></a><span class="lineno"> 9635</span>&#160;                document.body.scrollWidth</div>
<div class="line"><a name="l09636"></a><span class="lineno"> 9636</span>&#160;            );</div>
<div class="line"><a name="l09637"></a><span class="lineno"> 9637</span>&#160;            offsetWidth = Math.max(</div>
<div class="line"><a name="l09638"></a><span class="lineno"> 9638</span>&#160;                document.documentElement.offsetWidth,</div>
<div class="line"><a name="l09639"></a><span class="lineno"> 9639</span>&#160;                document.body.offsetWidth</div>
<div class="line"><a name="l09640"></a><span class="lineno"> 9640</span>&#160;            );</div>
<div class="line"><a name="l09641"></a><span class="lineno"> 9641</span>&#160;</div>
<div class="line"><a name="l09642"></a><span class="lineno"> 9642</span>&#160;            <span class="keywordflow">if</span> (scrollWidth &lt; offsetWidth) {</div>
<div class="line"><a name="l09643"></a><span class="lineno"> 9643</span>&#160;                <span class="keywordflow">return</span> $(window).width() + <span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l09644"></a><span class="lineno"> 9644</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09645"></a><span class="lineno"> 9645</span>&#160;                <span class="keywordflow">return</span> scrollWidth + <span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l09646"></a><span class="lineno"> 9646</span>&#160;            }</div>
<div class="line"><a name="l09647"></a><span class="lineno"> 9647</span>&#160;        <span class="comment">// handle &quot;good&quot; browsers</span></div>
<div class="line"><a name="l09648"></a><span class="lineno"> 9648</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09649"></a><span class="lineno"> 9649</span>&#160;            <span class="keywordflow">return</span> $(document).width() + <span class="stringliteral">&#39;px&#39;</span>;</div>
<div class="line"><a name="l09650"></a><span class="lineno"> 9650</span>&#160;        }</div>
<div class="line"><a name="l09651"></a><span class="lineno"> 9651</span>&#160;    },</div>
<div class="line"><a name="l09652"></a><span class="lineno"> 9652</span>&#160;</div>
<div class="line"><a name="l09653"></a><span class="lineno"> 9653</span>&#160;    resize: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09654"></a><span class="lineno"> 9654</span>&#160;        <span class="comment">/* If the dialog is draggable and the user drags it past the</span></div>
<div class="line"><a name="l09655"></a><span class="lineno"> 9655</span>&#160;<span class="comment">         * right edge of the window, the document becomes wider so we</span></div>
<div class="line"><a name="l09656"></a><span class="lineno"> 9656</span>&#160;<span class="comment">         * need to stretch the overlay. If the user then drags the</span></div>
<div class="line"><a name="l09657"></a><span class="lineno"> 9657</span>&#160;<span class="comment">         * dialog back to the left, the document will become narrower,</span></div>
<div class="line"><a name="l09658"></a><span class="lineno"> 9658</span>&#160;<span class="comment">         * so we need to shrink the overlay to the appropriate size.</span></div>
<div class="line"><a name="l09659"></a><span class="lineno"> 9659</span>&#160;<span class="comment">         * This is handled by shrinking the overlay before setting it</span></div>
<div class="line"><a name="l09660"></a><span class="lineno"> 9660</span>&#160;<span class="comment">         * to the full document size.</span></div>
<div class="line"><a name="l09661"></a><span class="lineno"> 9661</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l09662"></a><span class="lineno"> 9662</span>&#160;        var $overlays = $([]);</div>
<div class="line"><a name="l09663"></a><span class="lineno"> 9663</span>&#160;        $.each($.ui.dialog.overlay.instances, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09664"></a><span class="lineno"> 9664</span>&#160;            $overlays = $overlays.add(<span class="keyword">this</span>);</div>
<div class="line"><a name="l09665"></a><span class="lineno"> 9665</span>&#160;        });</div>
<div class="line"><a name="l09666"></a><span class="lineno"> 9666</span>&#160;</div>
<div class="line"><a name="l09667"></a><span class="lineno"> 9667</span>&#160;        $overlays.css({</div>
<div class="line"><a name="l09668"></a><span class="lineno"> 9668</span>&#160;            width: 0,</div>
<div class="line"><a name="l09669"></a><span class="lineno"> 9669</span>&#160;            height: 0</div>
<div class="line"><a name="l09670"></a><span class="lineno"> 9670</span>&#160;        }).css({</div>
<div class="line"><a name="l09671"></a><span class="lineno"> 9671</span>&#160;            width: $.ui.dialog.overlay.width(),</div>
<div class="line"><a name="l09672"></a><span class="lineno"> 9672</span>&#160;            height: $.ui.dialog.overlay.height()</div>
<div class="line"><a name="l09673"></a><span class="lineno"> 9673</span>&#160;        });</div>
<div class="line"><a name="l09674"></a><span class="lineno"> 9674</span>&#160;    }</div>
<div class="line"><a name="l09675"></a><span class="lineno"> 9675</span>&#160;});</div>
<div class="line"><a name="l09676"></a><span class="lineno"> 9676</span>&#160;</div>
<div class="line"><a name="l09677"></a><span class="lineno"> 9677</span>&#160;$.extend($.ui.dialog.overlay.prototype, {</div>
<div class="line"><a name="l09678"></a><span class="lineno"> 9678</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09679"></a><span class="lineno"> 9679</span>&#160;        $.ui.dialog.overlay.destroy(<span class="keyword">this</span>.$el);</div>
<div class="line"><a name="l09680"></a><span class="lineno"> 9680</span>&#160;    }</div>
<div class="line"><a name="l09681"></a><span class="lineno"> 9681</span>&#160;});</div>
<div class="line"><a name="l09682"></a><span class="lineno"> 9682</span>&#160;</div>
<div class="line"><a name="l09683"></a><span class="lineno"> 9683</span>&#160;}(jQuery));</div>
<div class="line"><a name="l09684"></a><span class="lineno"> 9684</span>&#160;</div>
<div class="line"><a name="l09685"></a><span class="lineno"> 9685</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l09686"></a><span class="lineno"> 9686</span>&#160;</div>
<div class="line"><a name="l09687"></a><span class="lineno"> 9687</span>&#160;$.ui = $.ui || {};</div>
<div class="line"><a name="l09688"></a><span class="lineno"> 9688</span>&#160;</div>
<div class="line"><a name="l09689"></a><span class="lineno"> 9689</span>&#160;var horizontalPositions = /left|center|right/,</div>
<div class="line"><a name="l09690"></a><span class="lineno"> 9690</span>&#160;    verticalPositions = /top|center|bottom/,</div>
<div class="line"><a name="l09691"></a><span class="lineno"> 9691</span>&#160;    center = <span class="stringliteral">&quot;center&quot;</span>,</div>
<div class="line"><a name="l09692"></a><span class="lineno"> 9692</span>&#160;    support = {},</div>
<div class="line"><a name="l09693"></a><span class="lineno"> 9693</span>&#160;    _position = $.fn.position,</div>
<div class="line"><a name="l09694"></a><span class="lineno"> 9694</span>&#160;    _offset = $.fn.offset;</div>
<div class="line"><a name="l09695"></a><span class="lineno"> 9695</span>&#160;</div>
<div class="line"><a name="l09696"></a><span class="lineno"> 9696</span>&#160;$.fn.position = <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l09697"></a><span class="lineno"> 9697</span>&#160;    <span class="keywordflow">if</span> ( !options || !options.of ) {</div>
<div class="line"><a name="l09698"></a><span class="lineno"> 9698</span>&#160;        <span class="keywordflow">return</span> _position.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l09699"></a><span class="lineno"> 9699</span>&#160;    }</div>
<div class="line"><a name="l09700"></a><span class="lineno"> 9700</span>&#160;</div>
<div class="line"><a name="l09701"></a><span class="lineno"> 9701</span>&#160;    <span class="comment">// make a copy, we don&#39;t want to modify arguments</span></div>
<div class="line"><a name="l09702"></a><span class="lineno"> 9702</span>&#160;    options = $.extend( {}, options );</div>
<div class="line"><a name="l09703"></a><span class="lineno"> 9703</span>&#160;</div>
<div class="line"><a name="l09704"></a><span class="lineno"> 9704</span>&#160;    var target = $( options.of ),</div>
<div class="line"><a name="l09705"></a><span class="lineno"> 9705</span>&#160;        targetElem = target[0],</div>
<div class="line"><a name="l09706"></a><span class="lineno"> 9706</span>&#160;        collision = ( options.collision || <span class="stringliteral">&quot;flip&quot;</span> ).split( <span class="stringliteral">&quot; &quot;</span> ),</div>
<div class="line"><a name="l09707"></a><span class="lineno"> 9707</span>&#160;        offset = options.offset ? options.offset.split( <span class="stringliteral">&quot; &quot;</span> ) : [ 0, 0 ],</div>
<div class="line"><a name="l09708"></a><span class="lineno"> 9708</span>&#160;        targetWidth,</div>
<div class="line"><a name="l09709"></a><span class="lineno"> 9709</span>&#160;        targetHeight,</div>
<div class="line"><a name="l09710"></a><span class="lineno"> 9710</span>&#160;        basePosition;</div>
<div class="line"><a name="l09711"></a><span class="lineno"> 9711</span>&#160;</div>
<div class="line"><a name="l09712"></a><span class="lineno"> 9712</span>&#160;    <span class="keywordflow">if</span> ( targetElem.nodeType === 9 ) {</div>
<div class="line"><a name="l09713"></a><span class="lineno"> 9713</span>&#160;        targetWidth = target.width();</div>
<div class="line"><a name="l09714"></a><span class="lineno"> 9714</span>&#160;        targetHeight = target.height();</div>
<div class="line"><a name="l09715"></a><span class="lineno"> 9715</span>&#160;        basePosition = { top: 0, left: 0 };</div>
<div class="line"><a name="l09716"></a><span class="lineno"> 9716</span>&#160;    <span class="comment">// TODO: use $.isWindow() in 1.9</span></div>
<div class="line"><a name="l09717"></a><span class="lineno"> 9717</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( targetElem.setTimeout ) {</div>
<div class="line"><a name="l09718"></a><span class="lineno"> 9718</span>&#160;        targetWidth = target.width();</div>
<div class="line"><a name="l09719"></a><span class="lineno"> 9719</span>&#160;        targetHeight = target.height();</div>
<div class="line"><a name="l09720"></a><span class="lineno"> 9720</span>&#160;        basePosition = { top: target.scrollTop(), left: target.scrollLeft() };</div>
<div class="line"><a name="l09721"></a><span class="lineno"> 9721</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( targetElem.preventDefault ) {</div>
<div class="line"><a name="l09722"></a><span class="lineno"> 9722</span>&#160;        <span class="comment">// force left top to allow flipping</span></div>
<div class="line"><a name="l09723"></a><span class="lineno"> 9723</span>&#160;        options.at = <span class="stringliteral">&quot;left top&quot;</span>;</div>
<div class="line"><a name="l09724"></a><span class="lineno"> 9724</span>&#160;        targetWidth = targetHeight = 0;</div>
<div class="line"><a name="l09725"></a><span class="lineno"> 9725</span>&#160;        basePosition = { top: options.of.pageY, left: options.of.pageX };</div>
<div class="line"><a name="l09726"></a><span class="lineno"> 9726</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09727"></a><span class="lineno"> 9727</span>&#160;        targetWidth = target.outerWidth();</div>
<div class="line"><a name="l09728"></a><span class="lineno"> 9728</span>&#160;        targetHeight = target.outerHeight();</div>
<div class="line"><a name="l09729"></a><span class="lineno"> 9729</span>&#160;        basePosition = target.offset();</div>
<div class="line"><a name="l09730"></a><span class="lineno"> 9730</span>&#160;    }</div>
<div class="line"><a name="l09731"></a><span class="lineno"> 9731</span>&#160;</div>
<div class="line"><a name="l09732"></a><span class="lineno"> 9732</span>&#160;    <span class="comment">// force my and at to have valid horizontal and veritcal positions</span></div>
<div class="line"><a name="l09733"></a><span class="lineno"> 9733</span>&#160;    <span class="comment">// if a value is missing or invalid, it will be converted to center </span></div>
<div class="line"><a name="l09734"></a><span class="lineno"> 9734</span>&#160;    $.each( [ <span class="stringliteral">&quot;my&quot;</span>, <span class="stringliteral">&quot;at&quot;</span> ], <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09735"></a><span class="lineno"> 9735</span>&#160;        var pos = ( options[<span class="keyword">this</span>] || <span class="stringliteral">&quot;&quot;</span> ).split( <span class="stringliteral">&quot; &quot;</span> );</div>
<div class="line"><a name="l09736"></a><span class="lineno"> 9736</span>&#160;        <span class="keywordflow">if</span> ( pos.length === 1) {</div>
<div class="line"><a name="l09737"></a><span class="lineno"> 9737</span>&#160;            pos = horizontalPositions.test( pos[0] ) ?</div>
<div class="line"><a name="l09738"></a><span class="lineno"> 9738</span>&#160;                pos.concat( [center] ) :</div>
<div class="line"><a name="l09739"></a><span class="lineno"> 9739</span>&#160;                verticalPositions.test( pos[0] ) ?</div>
<div class="line"><a name="l09740"></a><span class="lineno"> 9740</span>&#160;                    [ center ].concat( pos ) :</div>
<div class="line"><a name="l09741"></a><span class="lineno"> 9741</span>&#160;                    [ center, center ];</div>
<div class="line"><a name="l09742"></a><span class="lineno"> 9742</span>&#160;        }</div>
<div class="line"><a name="l09743"></a><span class="lineno"> 9743</span>&#160;        pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;</div>
<div class="line"><a name="l09744"></a><span class="lineno"> 9744</span>&#160;        pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;</div>
<div class="line"><a name="l09745"></a><span class="lineno"> 9745</span>&#160;        options[ this ] = pos;</div>
<div class="line"><a name="l09746"></a><span class="lineno"> 9746</span>&#160;    });</div>
<div class="line"><a name="l09747"></a><span class="lineno"> 9747</span>&#160;</div>
<div class="line"><a name="l09748"></a><span class="lineno"> 9748</span>&#160;    <span class="comment">// normalize collision option</span></div>
<div class="line"><a name="l09749"></a><span class="lineno"> 9749</span>&#160;    <span class="keywordflow">if</span> ( collision.length === 1 ) {</div>
<div class="line"><a name="l09750"></a><span class="lineno"> 9750</span>&#160;        collision[ 1 ] = collision[ 0 ];</div>
<div class="line"><a name="l09751"></a><span class="lineno"> 9751</span>&#160;    }</div>
<div class="line"><a name="l09752"></a><span class="lineno"> 9752</span>&#160;</div>
<div class="line"><a name="l09753"></a><span class="lineno"> 9753</span>&#160;    <span class="comment">// normalize offset option</span></div>
<div class="line"><a name="l09754"></a><span class="lineno"> 9754</span>&#160;    offset[ 0 ] = parseInt( offset[0], 10 ) || 0;</div>
<div class="line"><a name="l09755"></a><span class="lineno"> 9755</span>&#160;    <span class="keywordflow">if</span> ( offset.length === 1 ) {</div>
<div class="line"><a name="l09756"></a><span class="lineno"> 9756</span>&#160;        offset[ 1 ] = offset[ 0 ];</div>
<div class="line"><a name="l09757"></a><span class="lineno"> 9757</span>&#160;    }</div>
<div class="line"><a name="l09758"></a><span class="lineno"> 9758</span>&#160;    offset[ 1 ] = parseInt( offset[1], 10 ) || 0;</div>
<div class="line"><a name="l09759"></a><span class="lineno"> 9759</span>&#160;</div>
<div class="line"><a name="l09760"></a><span class="lineno"> 9760</span>&#160;    <span class="keywordflow">if</span> ( options.at[0] === <span class="stringliteral">&quot;right&quot;</span> ) {</div>
<div class="line"><a name="l09761"></a><span class="lineno"> 9761</span>&#160;        basePosition.left += targetWidth;</div>
<div class="line"><a name="l09762"></a><span class="lineno"> 9762</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( options.at[0] === center ) {</div>
<div class="line"><a name="l09763"></a><span class="lineno"> 9763</span>&#160;        basePosition.left += targetWidth / 2;</div>
<div class="line"><a name="l09764"></a><span class="lineno"> 9764</span>&#160;    }</div>
<div class="line"><a name="l09765"></a><span class="lineno"> 9765</span>&#160;</div>
<div class="line"><a name="l09766"></a><span class="lineno"> 9766</span>&#160;    <span class="keywordflow">if</span> ( options.at[1] === <span class="stringliteral">&quot;bottom&quot;</span> ) {</div>
<div class="line"><a name="l09767"></a><span class="lineno"> 9767</span>&#160;        basePosition.top += targetHeight;</div>
<div class="line"><a name="l09768"></a><span class="lineno"> 9768</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( options.at[1] === center ) {</div>
<div class="line"><a name="l09769"></a><span class="lineno"> 9769</span>&#160;        basePosition.top += targetHeight / 2;</div>
<div class="line"><a name="l09770"></a><span class="lineno"> 9770</span>&#160;    }</div>
<div class="line"><a name="l09771"></a><span class="lineno"> 9771</span>&#160;</div>
<div class="line"><a name="l09772"></a><span class="lineno"> 9772</span>&#160;    basePosition.left += offset[ 0 ];</div>
<div class="line"><a name="l09773"></a><span class="lineno"> 9773</span>&#160;    basePosition.top += offset[ 1 ];</div>
<div class="line"><a name="l09774"></a><span class="lineno"> 9774</span>&#160;</div>
<div class="line"><a name="l09775"></a><span class="lineno"> 9775</span>&#160;    <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l09776"></a><span class="lineno"> 9776</span>&#160;        var elem = $( this ),</div>
<div class="line"><a name="l09777"></a><span class="lineno"> 9777</span>&#160;            elemWidth = elem.outerWidth(),</div>
<div class="line"><a name="l09778"></a><span class="lineno"> 9778</span>&#160;            elemHeight = elem.outerHeight(),</div>
<div class="line"><a name="l09779"></a><span class="lineno"> 9779</span>&#160;            marginLeft = parseInt( $.curCSS( <span class="keyword">this</span>, <span class="stringliteral">&quot;marginLeft&quot;</span>, <span class="keyword">true</span> ) ) || 0,</div>
<div class="line"><a name="l09780"></a><span class="lineno"> 9780</span>&#160;            marginTop = parseInt( $.curCSS( <span class="keyword">this</span>, <span class="stringliteral">&quot;marginTop&quot;</span>, <span class="keyword">true</span> ) ) || 0,</div>
<div class="line"><a name="l09781"></a><span class="lineno"> 9781</span>&#160;            collisionWidth = elemWidth + marginLeft +</div>
<div class="line"><a name="l09782"></a><span class="lineno"> 9782</span>&#160;                ( parseInt( $.curCSS( <span class="keyword">this</span>, <span class="stringliteral">&quot;marginRight&quot;</span>, <span class="keyword">true</span> ) ) || 0 ),</div>
<div class="line"><a name="l09783"></a><span class="lineno"> 9783</span>&#160;            collisionHeight = elemHeight + marginTop +</div>
<div class="line"><a name="l09784"></a><span class="lineno"> 9784</span>&#160;                ( parseInt( $.curCSS( <span class="keyword">this</span>, <span class="stringliteral">&quot;marginBottom&quot;</span>, <span class="keyword">true</span> ) ) || 0 ),</div>
<div class="line"><a name="l09785"></a><span class="lineno"> 9785</span>&#160;            position = $.extend( {}, basePosition ),</div>
<div class="line"><a name="l09786"></a><span class="lineno"> 9786</span>&#160;            collisionPosition;</div>
<div class="line"><a name="l09787"></a><span class="lineno"> 9787</span>&#160;</div>
<div class="line"><a name="l09788"></a><span class="lineno"> 9788</span>&#160;        <span class="keywordflow">if</span> ( options.my[0] === <span class="stringliteral">&quot;right&quot;</span> ) {</div>
<div class="line"><a name="l09789"></a><span class="lineno"> 9789</span>&#160;            position.left -= elemWidth;</div>
<div class="line"><a name="l09790"></a><span class="lineno"> 9790</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( options.my[0] === center ) {</div>
<div class="line"><a name="l09791"></a><span class="lineno"> 9791</span>&#160;            position.left -= elemWidth / 2;</div>
<div class="line"><a name="l09792"></a><span class="lineno"> 9792</span>&#160;        }</div>
<div class="line"><a name="l09793"></a><span class="lineno"> 9793</span>&#160;</div>
<div class="line"><a name="l09794"></a><span class="lineno"> 9794</span>&#160;        <span class="keywordflow">if</span> ( options.my[1] === <span class="stringliteral">&quot;bottom&quot;</span> ) {</div>
<div class="line"><a name="l09795"></a><span class="lineno"> 9795</span>&#160;            position.top -= elemHeight;</div>
<div class="line"><a name="l09796"></a><span class="lineno"> 9796</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( options.my[1] === center ) {</div>
<div class="line"><a name="l09797"></a><span class="lineno"> 9797</span>&#160;            position.top -= elemHeight / 2;</div>
<div class="line"><a name="l09798"></a><span class="lineno"> 9798</span>&#160;        }</div>
<div class="line"><a name="l09799"></a><span class="lineno"> 9799</span>&#160;</div>
<div class="line"><a name="l09800"></a><span class="lineno"> 9800</span>&#160;        <span class="comment">// prevent fractions if jQuery version doesn&#39;t support them (see #5280)</span></div>
<div class="line"><a name="l09801"></a><span class="lineno"> 9801</span>&#160;        <span class="keywordflow">if</span> ( !support.fractions ) {</div>
<div class="line"><a name="l09802"></a><span class="lineno"> 9802</span>&#160;            position.left = Math.round( position.left );</div>
<div class="line"><a name="l09803"></a><span class="lineno"> 9803</span>&#160;            position.top = Math.round( position.top );</div>
<div class="line"><a name="l09804"></a><span class="lineno"> 9804</span>&#160;        }</div>
<div class="line"><a name="l09805"></a><span class="lineno"> 9805</span>&#160;</div>
<div class="line"><a name="l09806"></a><span class="lineno"> 9806</span>&#160;        collisionPosition = {</div>
<div class="line"><a name="l09807"></a><span class="lineno"> 9807</span>&#160;            left: position.left - marginLeft,</div>
<div class="line"><a name="l09808"></a><span class="lineno"> 9808</span>&#160;            top: position.top - marginTop</div>
<div class="line"><a name="l09809"></a><span class="lineno"> 9809</span>&#160;        };</div>
<div class="line"><a name="l09810"></a><span class="lineno"> 9810</span>&#160;</div>
<div class="line"><a name="l09811"></a><span class="lineno"> 9811</span>&#160;        $.each( [ <span class="stringliteral">&quot;left&quot;</span>, <span class="stringliteral">&quot;top&quot;</span> ], <span class="keyword">function</span>( i, dir ) {</div>
<div class="line"><a name="l09812"></a><span class="lineno"> 9812</span>&#160;            <span class="keywordflow">if</span> ( $.ui.position[ collision[i] ] ) {</div>
<div class="line"><a name="l09813"></a><span class="lineno"> 9813</span>&#160;                $.ui.position[ collision[i] ][ dir ]( position, {</div>
<div class="line"><a name="l09814"></a><span class="lineno"> 9814</span>&#160;                    targetWidth: targetWidth,</div>
<div class="line"><a name="l09815"></a><span class="lineno"> 9815</span>&#160;                    targetHeight: targetHeight,</div>
<div class="line"><a name="l09816"></a><span class="lineno"> 9816</span>&#160;                    elemWidth: elemWidth,</div>
<div class="line"><a name="l09817"></a><span class="lineno"> 9817</span>&#160;                    elemHeight: elemHeight,</div>
<div class="line"><a name="l09818"></a><span class="lineno"> 9818</span>&#160;                    collisionPosition: collisionPosition,</div>
<div class="line"><a name="l09819"></a><span class="lineno"> 9819</span>&#160;                    collisionWidth: collisionWidth,</div>
<div class="line"><a name="l09820"></a><span class="lineno"> 9820</span>&#160;                    collisionHeight: collisionHeight,</div>
<div class="line"><a name="l09821"></a><span class="lineno"> 9821</span>&#160;                    offset: offset,</div>
<div class="line"><a name="l09822"></a><span class="lineno"> 9822</span>&#160;                    my: options.my,</div>
<div class="line"><a name="l09823"></a><span class="lineno"> 9823</span>&#160;                    at: options.at</div>
<div class="line"><a name="l09824"></a><span class="lineno"> 9824</span>&#160;                });</div>
<div class="line"><a name="l09825"></a><span class="lineno"> 9825</span>&#160;            }</div>
<div class="line"><a name="l09826"></a><span class="lineno"> 9826</span>&#160;        });</div>
<div class="line"><a name="l09827"></a><span class="lineno"> 9827</span>&#160;</div>
<div class="line"><a name="l09828"></a><span class="lineno"> 9828</span>&#160;        <span class="keywordflow">if</span> ( $.fn.bgiframe ) {</div>
<div class="line"><a name="l09829"></a><span class="lineno"> 9829</span>&#160;            elem.bgiframe();</div>
<div class="line"><a name="l09830"></a><span class="lineno"> 9830</span>&#160;        }</div>
<div class="line"><a name="l09831"></a><span class="lineno"> 9831</span>&#160;        elem.offset( $.extend( position, { <span class="keyword">using</span>: options.using } ) );</div>
<div class="line"><a name="l09832"></a><span class="lineno"> 9832</span>&#160;    });</div>
<div class="line"><a name="l09833"></a><span class="lineno"> 9833</span>&#160;};</div>
<div class="line"><a name="l09834"></a><span class="lineno"> 9834</span>&#160;</div>
<div class="line"><a name="l09835"></a><span class="lineno"> 9835</span>&#160;$.ui.position = {</div>
<div class="line"><a name="l09836"></a><span class="lineno"> 9836</span>&#160;    fit: {</div>
<div class="line"><a name="l09837"></a><span class="lineno"> 9837</span>&#160;        left: <span class="keyword">function</span>( position, data ) {</div>
<div class="line"><a name="l09838"></a><span class="lineno"> 9838</span>&#160;            var win = $( window ),</div>
<div class="line"><a name="l09839"></a><span class="lineno"> 9839</span>&#160;                over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();</div>
<div class="line"><a name="l09840"></a><span class="lineno"> 9840</span>&#160;            position.left = over &gt; 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );</div>
<div class="line"><a name="l09841"></a><span class="lineno"> 9841</span>&#160;        },</div>
<div class="line"><a name="l09842"></a><span class="lineno"> 9842</span>&#160;        top: <span class="keyword">function</span>( position, data ) {</div>
<div class="line"><a name="l09843"></a><span class="lineno"> 9843</span>&#160;            var win = $( window ),</div>
<div class="line"><a name="l09844"></a><span class="lineno"> 9844</span>&#160;                over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();</div>
<div class="line"><a name="l09845"></a><span class="lineno"> 9845</span>&#160;            position.top = over &gt; 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );</div>
<div class="line"><a name="l09846"></a><span class="lineno"> 9846</span>&#160;        }</div>
<div class="line"><a name="l09847"></a><span class="lineno"> 9847</span>&#160;    },</div>
<div class="line"><a name="l09848"></a><span class="lineno"> 9848</span>&#160;</div>
<div class="line"><a name="l09849"></a><span class="lineno"> 9849</span>&#160;    flip: {</div>
<div class="line"><a name="l09850"></a><span class="lineno"> 9850</span>&#160;        left: <span class="keyword">function</span>( position, data ) {</div>
<div class="line"><a name="l09851"></a><span class="lineno"> 9851</span>&#160;            <span class="keywordflow">if</span> ( data.at[0] === center ) {</div>
<div class="line"><a name="l09852"></a><span class="lineno"> 9852</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l09853"></a><span class="lineno"> 9853</span>&#160;            }</div>
<div class="line"><a name="l09854"></a><span class="lineno"> 9854</span>&#160;            var win = $( window ),</div>
<div class="line"><a name="l09855"></a><span class="lineno"> 9855</span>&#160;                over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),</div>
<div class="line"><a name="l09856"></a><span class="lineno"> 9856</span>&#160;                myOffset = data.my[ 0 ] === <span class="stringliteral">&quot;left&quot;</span> ?</div>
<div class="line"><a name="l09857"></a><span class="lineno"> 9857</span>&#160;                    -data.elemWidth :</div>
<div class="line"><a name="l09858"></a><span class="lineno"> 9858</span>&#160;                    data.my[ 0 ] === <span class="stringliteral">&quot;right&quot;</span> ?</div>
<div class="line"><a name="l09859"></a><span class="lineno"> 9859</span>&#160;                        data.elemWidth :</div>
<div class="line"><a name="l09860"></a><span class="lineno"> 9860</span>&#160;                        0,</div>
<div class="line"><a name="l09861"></a><span class="lineno"> 9861</span>&#160;                atOffset = data.at[ 0 ] === <span class="stringliteral">&quot;left&quot;</span> ?</div>
<div class="line"><a name="l09862"></a><span class="lineno"> 9862</span>&#160;                    data.targetWidth :</div>
<div class="line"><a name="l09863"></a><span class="lineno"> 9863</span>&#160;                    -data.targetWidth,</div>
<div class="line"><a name="l09864"></a><span class="lineno"> 9864</span>&#160;                offset = -2 * data.offset[ 0 ];</div>
<div class="line"><a name="l09865"></a><span class="lineno"> 9865</span>&#160;            position.left += data.collisionPosition.left &lt; 0 ?</div>
<div class="line"><a name="l09866"></a><span class="lineno"> 9866</span>&#160;                myOffset + atOffset + offset :</div>
<div class="line"><a name="l09867"></a><span class="lineno"> 9867</span>&#160;                over &gt; 0 ?</div>
<div class="line"><a name="l09868"></a><span class="lineno"> 9868</span>&#160;                    myOffset + atOffset + offset :</div>
<div class="line"><a name="l09869"></a><span class="lineno"> 9869</span>&#160;                    0;</div>
<div class="line"><a name="l09870"></a><span class="lineno"> 9870</span>&#160;        },</div>
<div class="line"><a name="l09871"></a><span class="lineno"> 9871</span>&#160;        top: <span class="keyword">function</span>( position, data ) {</div>
<div class="line"><a name="l09872"></a><span class="lineno"> 9872</span>&#160;            <span class="keywordflow">if</span> ( data.at[1] === center ) {</div>
<div class="line"><a name="l09873"></a><span class="lineno"> 9873</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l09874"></a><span class="lineno"> 9874</span>&#160;            }</div>
<div class="line"><a name="l09875"></a><span class="lineno"> 9875</span>&#160;            var win = $( window ),</div>
<div class="line"><a name="l09876"></a><span class="lineno"> 9876</span>&#160;                over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),</div>
<div class="line"><a name="l09877"></a><span class="lineno"> 9877</span>&#160;                myOffset = data.my[ 1 ] === <span class="stringliteral">&quot;top&quot;</span> ?</div>
<div class="line"><a name="l09878"></a><span class="lineno"> 9878</span>&#160;                    -data.elemHeight :</div>
<div class="line"><a name="l09879"></a><span class="lineno"> 9879</span>&#160;                    data.my[ 1 ] === <span class="stringliteral">&quot;bottom&quot;</span> ?</div>
<div class="line"><a name="l09880"></a><span class="lineno"> 9880</span>&#160;                        data.elemHeight :</div>
<div class="line"><a name="l09881"></a><span class="lineno"> 9881</span>&#160;                        0,</div>
<div class="line"><a name="l09882"></a><span class="lineno"> 9882</span>&#160;                atOffset = data.at[ 1 ] === <span class="stringliteral">&quot;top&quot;</span> ?</div>
<div class="line"><a name="l09883"></a><span class="lineno"> 9883</span>&#160;                    data.targetHeight :</div>
<div class="line"><a name="l09884"></a><span class="lineno"> 9884</span>&#160;                    -data.targetHeight,</div>
<div class="line"><a name="l09885"></a><span class="lineno"> 9885</span>&#160;                offset = -2 * data.offset[ 1 ];</div>
<div class="line"><a name="l09886"></a><span class="lineno"> 9886</span>&#160;            position.top += data.collisionPosition.top &lt; 0 ?</div>
<div class="line"><a name="l09887"></a><span class="lineno"> 9887</span>&#160;                myOffset + atOffset + offset :</div>
<div class="line"><a name="l09888"></a><span class="lineno"> 9888</span>&#160;                over &gt; 0 ?</div>
<div class="line"><a name="l09889"></a><span class="lineno"> 9889</span>&#160;                    myOffset + atOffset + offset :</div>
<div class="line"><a name="l09890"></a><span class="lineno"> 9890</span>&#160;                    0;</div>
<div class="line"><a name="l09891"></a><span class="lineno"> 9891</span>&#160;        }</div>
<div class="line"><a name="l09892"></a><span class="lineno"> 9892</span>&#160;    }</div>
<div class="line"><a name="l09893"></a><span class="lineno"> 9893</span>&#160;};</div>
<div class="line"><a name="l09894"></a><span class="lineno"> 9894</span>&#160;</div>
<div class="line"><a name="l09895"></a><span class="lineno"> 9895</span>&#160;<span class="comment">// offset setter from jQuery 1.4</span></div>
<div class="line"><a name="l09896"></a><span class="lineno"> 9896</span>&#160;<span class="keywordflow">if</span> ( !$.offset.setOffset ) {</div>
<div class="line"><a name="l09897"></a><span class="lineno"> 9897</span>&#160;    $.offset.setOffset = <span class="keyword">function</span>( elem, options ) {</div>
<div class="line"><a name="l09898"></a><span class="lineno"> 9898</span>&#160;        <span class="comment">// set position first, in-case top/left are set even on static elem</span></div>
<div class="line"><a name="l09899"></a><span class="lineno"> 9899</span>&#160;        <span class="keywordflow">if</span> ( /<span class="keyword">static</span>/.test( $.curCSS( elem, <span class="stringliteral">&quot;position&quot;</span> ) ) ) {</div>
<div class="line"><a name="l09900"></a><span class="lineno"> 9900</span>&#160;            elem.style.position = <span class="stringliteral">&quot;relative&quot;</span>;</div>
<div class="line"><a name="l09901"></a><span class="lineno"> 9901</span>&#160;        }</div>
<div class="line"><a name="l09902"></a><span class="lineno"> 9902</span>&#160;        var curElem   = $( elem ),</div>
<div class="line"><a name="l09903"></a><span class="lineno"> 9903</span>&#160;            curOffset = curElem.offset(),</div>
<div class="line"><a name="l09904"></a><span class="lineno"> 9904</span>&#160;            curTop    = parseInt( $.curCSS( elem, <span class="stringliteral">&quot;top&quot;</span>,  <span class="keyword">true</span> ), 10 ) || 0,</div>
<div class="line"><a name="l09905"></a><span class="lineno"> 9905</span>&#160;            curLeft   = parseInt( $.curCSS( elem, <span class="stringliteral">&quot;left&quot;</span>, <span class="keyword">true</span> ), 10)  || 0,</div>
<div class="line"><a name="l09906"></a><span class="lineno"> 9906</span>&#160;            props     = {</div>
<div class="line"><a name="l09907"></a><span class="lineno"> 9907</span>&#160;                top:  (options.top  - curOffset.top)  + curTop,</div>
<div class="line"><a name="l09908"></a><span class="lineno"> 9908</span>&#160;                left: (options.left - curOffset.left) + curLeft</div>
<div class="line"><a name="l09909"></a><span class="lineno"> 9909</span>&#160;            };</div>
<div class="line"><a name="l09910"></a><span class="lineno"> 9910</span>&#160;        </div>
<div class="line"><a name="l09911"></a><span class="lineno"> 9911</span>&#160;        <span class="keywordflow">if</span> ( <span class="stringliteral">&#39;using&#39;</span> in options ) {</div>
<div class="line"><a name="l09912"></a><span class="lineno"> 9912</span>&#160;            options.using.call( elem, props );</div>
<div class="line"><a name="l09913"></a><span class="lineno"> 9913</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l09914"></a><span class="lineno"> 9914</span>&#160;            curElem.css( props );</div>
<div class="line"><a name="l09915"></a><span class="lineno"> 9915</span>&#160;        }</div>
<div class="line"><a name="l09916"></a><span class="lineno"> 9916</span>&#160;    };</div>
<div class="line"><a name="l09917"></a><span class="lineno"> 9917</span>&#160;</div>
<div class="line"><a name="l09918"></a><span class="lineno"> 9918</span>&#160;    $.fn.offset = <span class="keyword">function</span>( options ) {</div>
<div class="line"><a name="l09919"></a><span class="lineno"> 9919</span>&#160;        var elem = <span class="keyword">this</span>[ 0 ];</div>
<div class="line"><a name="l09920"></a><span class="lineno"> 9920</span>&#160;        <span class="keywordflow">if</span> ( !elem || !elem.ownerDocument ) { <span class="keywordflow">return</span> null; }</div>
<div class="line"><a name="l09921"></a><span class="lineno"> 9921</span>&#160;        <span class="keywordflow">if</span> ( options ) { </div>
<div class="line"><a name="l09922"></a><span class="lineno"> 9922</span>&#160;            <span class="keywordflow">return</span> this.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l09923"></a><span class="lineno"> 9923</span>&#160;                $.offset.setOffset( <span class="keyword">this</span>, options );</div>
<div class="line"><a name="l09924"></a><span class="lineno"> 9924</span>&#160;            });</div>
<div class="line"><a name="l09925"></a><span class="lineno"> 9925</span>&#160;        }</div>
<div class="line"><a name="l09926"></a><span class="lineno"> 9926</span>&#160;        <span class="keywordflow">return</span> _offset.call( <span class="keyword">this</span> );</div>
<div class="line"><a name="l09927"></a><span class="lineno"> 9927</span>&#160;    };</div>
<div class="line"><a name="l09928"></a><span class="lineno"> 9928</span>&#160;}</div>
<div class="line"><a name="l09929"></a><span class="lineno"> 9929</span>&#160;</div>
<div class="line"><a name="l09930"></a><span class="lineno"> 9930</span>&#160;<span class="comment">// fraction support test (older versions of jQuery don&#39;t support fractions)</span></div>
<div class="line"><a name="l09931"></a><span class="lineno"> 9931</span>&#160;(<span class="keyword">function</span> () {</div>
<div class="line"><a name="l09932"></a><span class="lineno"> 9932</span>&#160;    var body = document.getElementsByTagName( <span class="stringliteral">&quot;body&quot;</span> )[ 0 ], </div>
<div class="line"><a name="l09933"></a><span class="lineno"> 9933</span>&#160;        div = document.createElement( <span class="stringliteral">&quot;div&quot;</span> ),</div>
<div class="line"><a name="l09934"></a><span class="lineno"> 9934</span>&#160;        testElement, testElementParent, testElementStyle, offset, offsetTotal;</div>
<div class="line"><a name="l09935"></a><span class="lineno"> 9935</span>&#160;</div>
<div class="line"><a name="l09936"></a><span class="lineno"> 9936</span>&#160;    <span class="comment">//Create a &quot;fake body&quot; for testing based on method used in jQuery.support</span></div>
<div class="line"><a name="l09937"></a><span class="lineno"> 9937</span>&#160;    testElement = document.createElement( body ? <span class="stringliteral">&quot;div&quot;</span> : <span class="stringliteral">&quot;body&quot;</span> );</div>
<div class="line"><a name="l09938"></a><span class="lineno"> 9938</span>&#160;    testElementStyle = {</div>
<div class="line"><a name="l09939"></a><span class="lineno"> 9939</span>&#160;        visibility: <span class="stringliteral">&quot;hidden&quot;</span>,</div>
<div class="line"><a name="l09940"></a><span class="lineno"> 9940</span>&#160;        width: 0,</div>
<div class="line"><a name="l09941"></a><span class="lineno"> 9941</span>&#160;        height: 0,</div>
<div class="line"><a name="l09942"></a><span class="lineno"> 9942</span>&#160;        border: 0,</div>
<div class="line"><a name="l09943"></a><span class="lineno"> 9943</span>&#160;        margin: 0,</div>
<div class="line"><a name="l09944"></a><span class="lineno"> 9944</span>&#160;        background: <span class="stringliteral">&quot;none&quot;</span></div>
<div class="line"><a name="l09945"></a><span class="lineno"> 9945</span>&#160;    };</div>
<div class="line"><a name="l09946"></a><span class="lineno"> 9946</span>&#160;    <span class="keywordflow">if</span> ( body ) {</div>
<div class="line"><a name="l09947"></a><span class="lineno"> 9947</span>&#160;        $.extend( testElementStyle, {</div>
<div class="line"><a name="l09948"></a><span class="lineno"> 9948</span>&#160;            position: <span class="stringliteral">&quot;absolute&quot;</span>,</div>
<div class="line"><a name="l09949"></a><span class="lineno"> 9949</span>&#160;            left: <span class="stringliteral">&quot;-1000px&quot;</span>,</div>
<div class="line"><a name="l09950"></a><span class="lineno"> 9950</span>&#160;            top: <span class="stringliteral">&quot;-1000px&quot;</span></div>
<div class="line"><a name="l09951"></a><span class="lineno"> 9951</span>&#160;        });</div>
<div class="line"><a name="l09952"></a><span class="lineno"> 9952</span>&#160;    }</div>
<div class="line"><a name="l09953"></a><span class="lineno"> 9953</span>&#160;    <span class="keywordflow">for</span> ( var i in testElementStyle ) {</div>
<div class="line"><a name="l09954"></a><span class="lineno"> 9954</span>&#160;        testElement.style[ i ] = testElementStyle[ i ];</div>
<div class="line"><a name="l09955"></a><span class="lineno"> 9955</span>&#160;    }</div>
<div class="line"><a name="l09956"></a><span class="lineno"> 9956</span>&#160;    testElement.appendChild( div );</div>
<div class="line"><a name="l09957"></a><span class="lineno"> 9957</span>&#160;    testElementParent = body || document.documentElement;</div>
<div class="line"><a name="l09958"></a><span class="lineno"> 9958</span>&#160;    testElementParent.insertBefore( testElement, testElementParent.firstChild );</div>
<div class="line"><a name="l09959"></a><span class="lineno"> 9959</span>&#160;</div>
<div class="line"><a name="l09960"></a><span class="lineno"> 9960</span>&#160;    div.style.cssText = <span class="stringliteral">&quot;position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;&quot;</span>;</div>
<div class="line"><a name="l09961"></a><span class="lineno"> 9961</span>&#160;</div>
<div class="line"><a name="l09962"></a><span class="lineno"> 9962</span>&#160;    offset = $( div ).offset( <span class="keyword">function</span>( _, offset ) {</div>
<div class="line"><a name="l09963"></a><span class="lineno"> 9963</span>&#160;        <span class="keywordflow">return</span> offset;</div>
<div class="line"><a name="l09964"></a><span class="lineno"> 9964</span>&#160;    }).offset();</div>
<div class="line"><a name="l09965"></a><span class="lineno"> 9965</span>&#160;</div>
<div class="line"><a name="l09966"></a><span class="lineno"> 9966</span>&#160;    testElement.innerHTML = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><a name="l09967"></a><span class="lineno"> 9967</span>&#160;    testElementParent.removeChild( testElement );</div>
<div class="line"><a name="l09968"></a><span class="lineno"> 9968</span>&#160;</div>
<div class="line"><a name="l09969"></a><span class="lineno"> 9969</span>&#160;    offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 );</div>
<div class="line"><a name="l09970"></a><span class="lineno"> 9970</span>&#160;    support.fractions = offsetTotal &gt; 21 &amp;&amp; offsetTotal &lt; 22;</div>
<div class="line"><a name="l09971"></a><span class="lineno"> 9971</span>&#160;})();</div>
<div class="line"><a name="l09972"></a><span class="lineno"> 9972</span>&#160;</div>
<div class="line"><a name="l09973"></a><span class="lineno"> 9973</span>&#160;}( jQuery ));</div>
<div class="line"><a name="l09974"></a><span class="lineno"> 9974</span>&#160;</div>
<div class="line"><a name="l09975"></a><span class="lineno"> 9975</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l09976"></a><span class="lineno"> 9976</span>&#160;</div>
<div class="line"><a name="l09977"></a><span class="lineno"> 9977</span>&#160;$.widget( <span class="stringliteral">&quot;ui.progressbar&quot;</span>, {</div>
<div class="line"><a name="l09978"></a><span class="lineno"> 9978</span>&#160;    options: {</div>
<div class="line"><a name="l09979"></a><span class="lineno"> 9979</span>&#160;        value: 0,</div>
<div class="line"><a name="l09980"></a><span class="lineno"> 9980</span>&#160;        max: 100</div>
<div class="line"><a name="l09981"></a><span class="lineno"> 9981</span>&#160;    },</div>
<div class="line"><a name="l09982"></a><span class="lineno"> 9982</span>&#160;</div>
<div class="line"><a name="l09983"></a><span class="lineno"> 9983</span>&#160;    min: 0,</div>
<div class="line"><a name="l09984"></a><span class="lineno"> 9984</span>&#160;</div>
<div class="line"><a name="l09985"></a><span class="lineno"> 9985</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l09986"></a><span class="lineno"> 9986</span>&#160;        this.element</div>
<div class="line"><a name="l09987"></a><span class="lineno"> 9987</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-progressbar ui-widget ui-widget-content ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l09988"></a><span class="lineno"> 9988</span>&#160;            .attr({</div>
<div class="line"><a name="l09989"></a><span class="lineno"> 9989</span>&#160;                role: <span class="stringliteral">&quot;progressbar&quot;</span>,</div>
<div class="line"><a name="l09990"></a><span class="lineno"> 9990</span>&#160;                <span class="stringliteral">&quot;aria-valuemin&quot;</span>: this.min,</div>
<div class="line"><a name="l09991"></a><span class="lineno"> 9991</span>&#160;                <span class="stringliteral">&quot;aria-valuemax&quot;</span>: this.options.max,</div>
<div class="line"><a name="l09992"></a><span class="lineno"> 9992</span>&#160;                <span class="stringliteral">&quot;aria-valuenow&quot;</span>: this._value()</div>
<div class="line"><a name="l09993"></a><span class="lineno"> 9993</span>&#160;            });</div>
<div class="line"><a name="l09994"></a><span class="lineno"> 9994</span>&#160;</div>
<div class="line"><a name="l09995"></a><span class="lineno"> 9995</span>&#160;        this.valueDiv = $( <span class="stringliteral">&quot;&lt;div class=&#39;ui-progressbar-value ui-widget-header ui-corner-left&#39;&gt;&lt;/div&gt;&quot;</span> )</div>
<div class="line"><a name="l09996"></a><span class="lineno"> 9996</span>&#160;            .appendTo( this.element );</div>
<div class="line"><a name="l09997"></a><span class="lineno"> 9997</span>&#160;</div>
<div class="line"><a name="l09998"></a><span class="lineno"> 9998</span>&#160;        this.oldValue = this._value();</div>
<div class="line"><a name="l09999"></a><span class="lineno"> 9999</span>&#160;        this._refreshValue();</div>
<div class="line"><a name="l10000"></a><span class="lineno">10000</span>&#160;    },</div>
<div class="line"><a name="l10001"></a><span class="lineno">10001</span>&#160;</div>
<div class="line"><a name="l10002"></a><span class="lineno">10002</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10003"></a><span class="lineno">10003</span>&#160;        this.element</div>
<div class="line"><a name="l10004"></a><span class="lineno">10004</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-progressbar ui-widget ui-widget-content ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l10005"></a><span class="lineno">10005</span>&#160;            .removeAttr( <span class="stringliteral">&quot;role&quot;</span> )</div>
<div class="line"><a name="l10006"></a><span class="lineno">10006</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-valuemin&quot;</span> )</div>
<div class="line"><a name="l10007"></a><span class="lineno">10007</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-valuemax&quot;</span> )</div>
<div class="line"><a name="l10008"></a><span class="lineno">10008</span>&#160;            .removeAttr( <span class="stringliteral">&quot;aria-valuenow&quot;</span> );</div>
<div class="line"><a name="l10009"></a><span class="lineno">10009</span>&#160;</div>
<div class="line"><a name="l10010"></a><span class="lineno">10010</span>&#160;        this.valueDiv.remove();</div>
<div class="line"><a name="l10011"></a><span class="lineno">10011</span>&#160;</div>
<div class="line"><a name="l10012"></a><span class="lineno">10012</span>&#160;        $.Widget.prototype.destroy.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l10013"></a><span class="lineno">10013</span>&#160;    },</div>
<div class="line"><a name="l10014"></a><span class="lineno">10014</span>&#160;</div>
<div class="line"><a name="l10015"></a><span class="lineno">10015</span>&#160;    value: <span class="keyword">function</span>( newValue ) {</div>
<div class="line"><a name="l10016"></a><span class="lineno">10016</span>&#160;        <span class="keywordflow">if</span> ( newValue === undefined ) {</div>
<div class="line"><a name="l10017"></a><span class="lineno">10017</span>&#160;            <span class="keywordflow">return</span> this._value();</div>
<div class="line"><a name="l10018"></a><span class="lineno">10018</span>&#160;        }</div>
<div class="line"><a name="l10019"></a><span class="lineno">10019</span>&#160;</div>
<div class="line"><a name="l10020"></a><span class="lineno">10020</span>&#160;        this._setOption( <span class="stringliteral">&quot;value&quot;</span>, newValue );</div>
<div class="line"><a name="l10021"></a><span class="lineno">10021</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l10022"></a><span class="lineno">10022</span>&#160;    },</div>
<div class="line"><a name="l10023"></a><span class="lineno">10023</span>&#160;</div>
<div class="line"><a name="l10024"></a><span class="lineno">10024</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l10025"></a><span class="lineno">10025</span>&#160;        <span class="keywordflow">if</span> ( key === <span class="stringliteral">&quot;value&quot;</span> ) {</div>
<div class="line"><a name="l10026"></a><span class="lineno">10026</span>&#160;            this.options.value = value;</div>
<div class="line"><a name="l10027"></a><span class="lineno">10027</span>&#160;            this._refreshValue();</div>
<div class="line"><a name="l10028"></a><span class="lineno">10028</span>&#160;            <span class="keywordflow">if</span> ( this._value() === this.options.max ) {</div>
<div class="line"><a name="l10029"></a><span class="lineno">10029</span>&#160;                this._trigger( <span class="stringliteral">&quot;complete&quot;</span> );</div>
<div class="line"><a name="l10030"></a><span class="lineno">10030</span>&#160;            }</div>
<div class="line"><a name="l10031"></a><span class="lineno">10031</span>&#160;        }</div>
<div class="line"><a name="l10032"></a><span class="lineno">10032</span>&#160;</div>
<div class="line"><a name="l10033"></a><span class="lineno">10033</span>&#160;        $.Widget.prototype._setOption.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l10034"></a><span class="lineno">10034</span>&#160;    },</div>
<div class="line"><a name="l10035"></a><span class="lineno">10035</span>&#160;</div>
<div class="line"><a name="l10036"></a><span class="lineno">10036</span>&#160;    _value: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10037"></a><span class="lineno">10037</span>&#160;        var val = this.options.value;</div>
<div class="line"><a name="l10038"></a><span class="lineno">10038</span>&#160;        <span class="comment">// normalize invalid value</span></div>
<div class="line"><a name="l10039"></a><span class="lineno">10039</span>&#160;        <span class="keywordflow">if</span> ( typeof val !== <span class="stringliteral">&quot;number&quot;</span> ) {</div>
<div class="line"><a name="l10040"></a><span class="lineno">10040</span>&#160;            val = 0;</div>
<div class="line"><a name="l10041"></a><span class="lineno">10041</span>&#160;        }</div>
<div class="line"><a name="l10042"></a><span class="lineno">10042</span>&#160;        <span class="keywordflow">return</span> Math.min( this.options.max, Math.max( <span class="keyword">this</span>.min, val ) );</div>
<div class="line"><a name="l10043"></a><span class="lineno">10043</span>&#160;    },</div>
<div class="line"><a name="l10044"></a><span class="lineno">10044</span>&#160;</div>
<div class="line"><a name="l10045"></a><span class="lineno">10045</span>&#160;    _percentage: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10046"></a><span class="lineno">10046</span>&#160;        <span class="keywordflow">return</span> 100 * this._value() / this.options.max;</div>
<div class="line"><a name="l10047"></a><span class="lineno">10047</span>&#160;    },</div>
<div class="line"><a name="l10048"></a><span class="lineno">10048</span>&#160;</div>
<div class="line"><a name="l10049"></a><span class="lineno">10049</span>&#160;    _refreshValue: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10050"></a><span class="lineno">10050</span>&#160;        var value = this.value();</div>
<div class="line"><a name="l10051"></a><span class="lineno">10051</span>&#160;        var percentage = this._percentage();</div>
<div class="line"><a name="l10052"></a><span class="lineno">10052</span>&#160;</div>
<div class="line"><a name="l10053"></a><span class="lineno">10053</span>&#160;        <span class="keywordflow">if</span> ( this.oldValue !== value ) {</div>
<div class="line"><a name="l10054"></a><span class="lineno">10054</span>&#160;            this.oldValue = value;</div>
<div class="line"><a name="l10055"></a><span class="lineno">10055</span>&#160;            this._trigger( <span class="stringliteral">&quot;change&quot;</span> );</div>
<div class="line"><a name="l10056"></a><span class="lineno">10056</span>&#160;        }</div>
<div class="line"><a name="l10057"></a><span class="lineno">10057</span>&#160;</div>
<div class="line"><a name="l10058"></a><span class="lineno">10058</span>&#160;        this.valueDiv</div>
<div class="line"><a name="l10059"></a><span class="lineno">10059</span>&#160;            .toggle( value &gt; this.min )</div>
<div class="line"><a name="l10060"></a><span class="lineno">10060</span>&#160;            .toggleClass( <span class="stringliteral">&quot;ui-corner-right&quot;</span>, value === this.options.max )</div>
<div class="line"><a name="l10061"></a><span class="lineno">10061</span>&#160;            .width( percentage.toFixed(0) + <span class="stringliteral">&quot;%&quot;</span> );</div>
<div class="line"><a name="l10062"></a><span class="lineno">10062</span>&#160;        this.element.attr( <span class="stringliteral">&quot;aria-valuenow&quot;</span>, value );</div>
<div class="line"><a name="l10063"></a><span class="lineno">10063</span>&#160;    }</div>
<div class="line"><a name="l10064"></a><span class="lineno">10064</span>&#160;});</div>
<div class="line"><a name="l10065"></a><span class="lineno">10065</span>&#160;</div>
<div class="line"><a name="l10066"></a><span class="lineno">10066</span>&#160;$.extend( $.ui.progressbar, {</div>
<div class="line"><a name="l10067"></a><span class="lineno">10067</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l10068"></a><span class="lineno">10068</span>&#160;});</div>
<div class="line"><a name="l10069"></a><span class="lineno">10069</span>&#160;</div>
<div class="line"><a name="l10070"></a><span class="lineno">10070</span>&#160;})( jQuery );</div>
<div class="line"><a name="l10071"></a><span class="lineno">10071</span>&#160;</div>
<div class="line"><a name="l10072"></a><span class="lineno">10072</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l10073"></a><span class="lineno">10073</span>&#160;</div>
<div class="line"><a name="l10074"></a><span class="lineno">10074</span>&#160;<span class="comment">// number of pages in a slider</span></div>
<div class="line"><a name="l10075"></a><span class="lineno">10075</span>&#160;<span class="comment">// (how many times can you page up/down to go through the whole range)</span></div>
<div class="line"><a name="l10076"></a><span class="lineno">10076</span>&#160;var numPages = 5;</div>
<div class="line"><a name="l10077"></a><span class="lineno">10077</span>&#160;</div>
<div class="line"><a name="l10078"></a><span class="lineno">10078</span>&#160;$.widget( <span class="stringliteral">&quot;ui.slider&quot;</span>, $.ui.mouse, {</div>
<div class="line"><a name="l10079"></a><span class="lineno">10079</span>&#160;</div>
<div class="line"><a name="l10080"></a><span class="lineno">10080</span>&#160;    widgetEventPrefix: <span class="stringliteral">&quot;slide&quot;</span>,</div>
<div class="line"><a name="l10081"></a><span class="lineno">10081</span>&#160;</div>
<div class="line"><a name="l10082"></a><span class="lineno">10082</span>&#160;    options: {</div>
<div class="line"><a name="l10083"></a><span class="lineno">10083</span>&#160;        animate: <span class="keyword">false</span>,</div>
<div class="line"><a name="l10084"></a><span class="lineno">10084</span>&#160;        distance: 0,</div>
<div class="line"><a name="l10085"></a><span class="lineno">10085</span>&#160;        max: 100,</div>
<div class="line"><a name="l10086"></a><span class="lineno">10086</span>&#160;        min: 0,</div>
<div class="line"><a name="l10087"></a><span class="lineno">10087</span>&#160;        orientation: <span class="stringliteral">&quot;horizontal&quot;</span>,</div>
<div class="line"><a name="l10088"></a><span class="lineno">10088</span>&#160;        range: <span class="keyword">false</span>,</div>
<div class="line"><a name="l10089"></a><span class="lineno">10089</span>&#160;        step: 1,</div>
<div class="line"><a name="l10090"></a><span class="lineno">10090</span>&#160;        value: 0,</div>
<div class="line"><a name="l10091"></a><span class="lineno">10091</span>&#160;        values: null</div>
<div class="line"><a name="l10092"></a><span class="lineno">10092</span>&#160;    },</div>
<div class="line"><a name="l10093"></a><span class="lineno">10093</span>&#160;</div>
<div class="line"><a name="l10094"></a><span class="lineno">10094</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10095"></a><span class="lineno">10095</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l10096"></a><span class="lineno">10096</span>&#160;            o = this.options,</div>
<div class="line"><a name="l10097"></a><span class="lineno">10097</span>&#160;            existingHandles = this.element.find( <span class="stringliteral">&quot;.ui-slider-handle&quot;</span> ).addClass( <span class="stringliteral">&quot;ui-state-default ui-corner-all&quot;</span> ),</div>
<div class="line"><a name="l10098"></a><span class="lineno">10098</span>&#160;            handle = <span class="stringliteral">&quot;&lt;a class=&#39;ui-slider-handle ui-state-default ui-corner-all&#39; href=&#39;#&#39;&gt;&lt;/a&gt;&quot;</span>,</div>
<div class="line"><a name="l10099"></a><span class="lineno">10099</span>&#160;            handleCount = ( o.values &amp;&amp; o.values.length ) || 1,</div>
<div class="line"><a name="l10100"></a><span class="lineno">10100</span>&#160;            handles = [];</div>
<div class="line"><a name="l10101"></a><span class="lineno">10101</span>&#160;</div>
<div class="line"><a name="l10102"></a><span class="lineno">10102</span>&#160;        this._keySliding = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10103"></a><span class="lineno">10103</span>&#160;        this._mouseSliding = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10104"></a><span class="lineno">10104</span>&#160;        this._animateOff = <span class="keyword">true</span>;</div>
<div class="line"><a name="l10105"></a><span class="lineno">10105</span>&#160;        this._handleIndex = null;</div>
<div class="line"><a name="l10106"></a><span class="lineno">10106</span>&#160;        this._detectOrientation();</div>
<div class="line"><a name="l10107"></a><span class="lineno">10107</span>&#160;        this._mouseInit();</div>
<div class="line"><a name="l10108"></a><span class="lineno">10108</span>&#160;</div>
<div class="line"><a name="l10109"></a><span class="lineno">10109</span>&#160;        this.element</div>
<div class="line"><a name="l10110"></a><span class="lineno">10110</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-slider&quot;</span> +</div>
<div class="line"><a name="l10111"></a><span class="lineno">10111</span>&#160;                <span class="stringliteral">&quot; ui-slider-&quot;</span> + this.orientation +</div>
<div class="line"><a name="l10112"></a><span class="lineno">10112</span>&#160;                <span class="stringliteral">&quot; ui-widget&quot;</span> +</div>
<div class="line"><a name="l10113"></a><span class="lineno">10113</span>&#160;                <span class="stringliteral">&quot; ui-widget-content&quot;</span> +</div>
<div class="line"><a name="l10114"></a><span class="lineno">10114</span>&#160;                <span class="stringliteral">&quot; ui-corner-all&quot;</span> +</div>
<div class="line"><a name="l10115"></a><span class="lineno">10115</span>&#160;                ( o.disabled ? <span class="stringliteral">&quot; ui-slider-disabled ui-disabled&quot;</span> : <span class="stringliteral">&quot;&quot;</span> ) );</div>
<div class="line"><a name="l10116"></a><span class="lineno">10116</span>&#160;</div>
<div class="line"><a name="l10117"></a><span class="lineno">10117</span>&#160;        this.range = $([]);</div>
<div class="line"><a name="l10118"></a><span class="lineno">10118</span>&#160;</div>
<div class="line"><a name="l10119"></a><span class="lineno">10119</span>&#160;        <span class="keywordflow">if</span> ( o.range ) {</div>
<div class="line"><a name="l10120"></a><span class="lineno">10120</span>&#160;            <span class="keywordflow">if</span> ( o.range === <span class="keyword">true</span> ) {</div>
<div class="line"><a name="l10121"></a><span class="lineno">10121</span>&#160;                <span class="keywordflow">if</span> ( !o.values ) {</div>
<div class="line"><a name="l10122"></a><span class="lineno">10122</span>&#160;                    o.values = [ this._valueMin(), this._valueMin() ];</div>
<div class="line"><a name="l10123"></a><span class="lineno">10123</span>&#160;                }</div>
<div class="line"><a name="l10124"></a><span class="lineno">10124</span>&#160;                <span class="keywordflow">if</span> ( o.values.length &amp;&amp; o.values.length !== 2 ) {</div>
<div class="line"><a name="l10125"></a><span class="lineno">10125</span>&#160;                    o.values = [ o.values[0], o.values[0] ];</div>
<div class="line"><a name="l10126"></a><span class="lineno">10126</span>&#160;                }</div>
<div class="line"><a name="l10127"></a><span class="lineno">10127</span>&#160;            }</div>
<div class="line"><a name="l10128"></a><span class="lineno">10128</span>&#160;</div>
<div class="line"><a name="l10129"></a><span class="lineno">10129</span>&#160;            this.range = $( <span class="stringliteral">&quot;&lt;div&gt;&lt;/div&gt;&quot;</span> )</div>
<div class="line"><a name="l10130"></a><span class="lineno">10130</span>&#160;                .appendTo( this.element )</div>
<div class="line"><a name="l10131"></a><span class="lineno">10131</span>&#160;                .addClass( <span class="stringliteral">&quot;ui-slider-range&quot;</span> +</div>
<div class="line"><a name="l10132"></a><span class="lineno">10132</span>&#160;                <span class="comment">// note: this isn&#39;t the most fittingly semantic framework class for this element,</span></div>
<div class="line"><a name="l10133"></a><span class="lineno">10133</span>&#160;                <span class="comment">// but worked best visually with a variety of themes</span></div>
<div class="line"><a name="l10134"></a><span class="lineno">10134</span>&#160;                <span class="stringliteral">&quot; ui-widget-header&quot;</span> + </div>
<div class="line"><a name="l10135"></a><span class="lineno">10135</span>&#160;                ( ( o.range === <span class="stringliteral">&quot;min&quot;</span> || o.range === <span class="stringliteral">&quot;max&quot;</span> ) ? <span class="stringliteral">&quot; ui-slider-range-&quot;</span> + o.range : <span class="stringliteral">&quot;&quot;</span> ) );</div>
<div class="line"><a name="l10136"></a><span class="lineno">10136</span>&#160;        }</div>
<div class="line"><a name="l10137"></a><span class="lineno">10137</span>&#160;</div>
<div class="line"><a name="l10138"></a><span class="lineno">10138</span>&#160;        <span class="keywordflow">for</span> ( var i = existingHandles.length; i &lt; handleCount; i += 1 ) {</div>
<div class="line"><a name="l10139"></a><span class="lineno">10139</span>&#160;            handles.push( handle );</div>
<div class="line"><a name="l10140"></a><span class="lineno">10140</span>&#160;        }</div>
<div class="line"><a name="l10141"></a><span class="lineno">10141</span>&#160;</div>
<div class="line"><a name="l10142"></a><span class="lineno">10142</span>&#160;        this.handles = existingHandles.add( $( handles.join( <span class="stringliteral">&quot;&quot;</span> ) ).appendTo( <span class="keyword">self</span>.element ) );</div>
<div class="line"><a name="l10143"></a><span class="lineno">10143</span>&#160;</div>
<div class="line"><a name="l10144"></a><span class="lineno">10144</span>&#160;        this.handle = this.handles.eq( 0 );</div>
<div class="line"><a name="l10145"></a><span class="lineno">10145</span>&#160;</div>
<div class="line"><a name="l10146"></a><span class="lineno">10146</span>&#160;        this.handles.add( this.range ).filter( <span class="stringliteral">&quot;a&quot;</span> )</div>
<div class="line"><a name="l10147"></a><span class="lineno">10147</span>&#160;            .click(<span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10148"></a><span class="lineno">10148</span>&#160;                <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l10149"></a><span class="lineno">10149</span>&#160;            })</div>
<div class="line"><a name="l10150"></a><span class="lineno">10150</span>&#160;            .hover(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l10151"></a><span class="lineno">10151</span>&#160;                <span class="keywordflow">if</span> ( !o.disabled ) {</div>
<div class="line"><a name="l10152"></a><span class="lineno">10152</span>&#160;                    $( this ).addClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> );</div>
<div class="line"><a name="l10153"></a><span class="lineno">10153</span>&#160;                }</div>
<div class="line"><a name="l10154"></a><span class="lineno">10154</span>&#160;            }, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10155"></a><span class="lineno">10155</span>&#160;                $( this ).removeClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> );</div>
<div class="line"><a name="l10156"></a><span class="lineno">10156</span>&#160;            })</div>
<div class="line"><a name="l10157"></a><span class="lineno">10157</span>&#160;            .focus(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l10158"></a><span class="lineno">10158</span>&#160;                <span class="keywordflow">if</span> ( !o.disabled ) {</div>
<div class="line"><a name="l10159"></a><span class="lineno">10159</span>&#160;                    $( <span class="stringliteral">&quot;.ui-slider .ui-state-focus&quot;</span> ).removeClass( <span class="stringliteral">&quot;ui-state-focus&quot;</span> );</div>
<div class="line"><a name="l10160"></a><span class="lineno">10160</span>&#160;                    $( this ).addClass( <span class="stringliteral">&quot;ui-state-focus&quot;</span> );</div>
<div class="line"><a name="l10161"></a><span class="lineno">10161</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10162"></a><span class="lineno">10162</span>&#160;                    $( this ).blur();</div>
<div class="line"><a name="l10163"></a><span class="lineno">10163</span>&#160;                }</div>
<div class="line"><a name="l10164"></a><span class="lineno">10164</span>&#160;            })</div>
<div class="line"><a name="l10165"></a><span class="lineno">10165</span>&#160;            .blur(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l10166"></a><span class="lineno">10166</span>&#160;                $( this ).removeClass( <span class="stringliteral">&quot;ui-state-focus&quot;</span> );</div>
<div class="line"><a name="l10167"></a><span class="lineno">10167</span>&#160;            });</div>
<div class="line"><a name="l10168"></a><span class="lineno">10168</span>&#160;</div>
<div class="line"><a name="l10169"></a><span class="lineno">10169</span>&#160;        this.handles.each(<span class="keyword">function</span>( i ) {</div>
<div class="line"><a name="l10170"></a><span class="lineno">10170</span>&#160;            $( this ).data( <span class="stringliteral">&quot;index.ui-slider-handle&quot;</span>, i );</div>
<div class="line"><a name="l10171"></a><span class="lineno">10171</span>&#160;        });</div>
<div class="line"><a name="l10172"></a><span class="lineno">10172</span>&#160;</div>
<div class="line"><a name="l10173"></a><span class="lineno">10173</span>&#160;        this.handles</div>
<div class="line"><a name="l10174"></a><span class="lineno">10174</span>&#160;            .keydown(<span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10175"></a><span class="lineno">10175</span>&#160;                var index = $( this ).data( <span class="stringliteral">&quot;index.ui-slider-handle&quot;</span> ),</div>
<div class="line"><a name="l10176"></a><span class="lineno">10176</span>&#160;                    allowed,</div>
<div class="line"><a name="l10177"></a><span class="lineno">10177</span>&#160;                    curVal,</div>
<div class="line"><a name="l10178"></a><span class="lineno">10178</span>&#160;                    newVal,</div>
<div class="line"><a name="l10179"></a><span class="lineno">10179</span>&#160;                    step;</div>
<div class="line"><a name="l10180"></a><span class="lineno">10180</span>&#160;    </div>
<div class="line"><a name="l10181"></a><span class="lineno">10181</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.options.disabled ) {</div>
<div class="line"><a name="l10182"></a><span class="lineno">10182</span>&#160;                    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10183"></a><span class="lineno">10183</span>&#160;                }</div>
<div class="line"><a name="l10184"></a><span class="lineno">10184</span>&#160;    </div>
<div class="line"><a name="l10185"></a><span class="lineno">10185</span>&#160;                <span class="keywordflow">switch</span> ( event.keyCode ) {</div>
<div class="line"><a name="l10186"></a><span class="lineno">10186</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.HOME:</div>
<div class="line"><a name="l10187"></a><span class="lineno">10187</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.END:</div>
<div class="line"><a name="l10188"></a><span class="lineno">10188</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.PAGE_UP:</div>
<div class="line"><a name="l10189"></a><span class="lineno">10189</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.PAGE_DOWN:</div>
<div class="line"><a name="l10190"></a><span class="lineno">10190</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.UP:</div>
<div class="line"><a name="l10191"></a><span class="lineno">10191</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.RIGHT:</div>
<div class="line"><a name="l10192"></a><span class="lineno">10192</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.DOWN:</div>
<div class="line"><a name="l10193"></a><span class="lineno">10193</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.LEFT:</div>
<div class="line"><a name="l10194"></a><span class="lineno">10194</span>&#160;                        <span class="keyword">event</span>.preventDefault();</div>
<div class="line"><a name="l10195"></a><span class="lineno">10195</span>&#160;                        <span class="keywordflow">if</span> ( !<span class="keyword">self</span>._keySliding ) {</div>
<div class="line"><a name="l10196"></a><span class="lineno">10196</span>&#160;                            <span class="keyword">self</span>._keySliding = <span class="keyword">true</span>;</div>
<div class="line"><a name="l10197"></a><span class="lineno">10197</span>&#160;                            $( this ).addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l10198"></a><span class="lineno">10198</span>&#160;                            allowed = <span class="keyword">self</span>._start( event, index );</div>
<div class="line"><a name="l10199"></a><span class="lineno">10199</span>&#160;                            <span class="keywordflow">if</span> ( allowed === <span class="keyword">false</span> ) {</div>
<div class="line"><a name="l10200"></a><span class="lineno">10200</span>&#160;                                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10201"></a><span class="lineno">10201</span>&#160;                            }</div>
<div class="line"><a name="l10202"></a><span class="lineno">10202</span>&#160;                        }</div>
<div class="line"><a name="l10203"></a><span class="lineno">10203</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10204"></a><span class="lineno">10204</span>&#160;                }</div>
<div class="line"><a name="l10205"></a><span class="lineno">10205</span>&#160;    </div>
<div class="line"><a name="l10206"></a><span class="lineno">10206</span>&#160;                step = <span class="keyword">self</span>.options.step;</div>
<div class="line"><a name="l10207"></a><span class="lineno">10207</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.options.values &amp;&amp; <span class="keyword">self</span>.options.values.length ) {</div>
<div class="line"><a name="l10208"></a><span class="lineno">10208</span>&#160;                    curVal = newVal = <span class="keyword">self</span>.values( index );</div>
<div class="line"><a name="l10209"></a><span class="lineno">10209</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10210"></a><span class="lineno">10210</span>&#160;                    curVal = newVal = <span class="keyword">self</span>.value();</div>
<div class="line"><a name="l10211"></a><span class="lineno">10211</span>&#160;                }</div>
<div class="line"><a name="l10212"></a><span class="lineno">10212</span>&#160;    </div>
<div class="line"><a name="l10213"></a><span class="lineno">10213</span>&#160;                <span class="keywordflow">switch</span> ( event.keyCode ) {</div>
<div class="line"><a name="l10214"></a><span class="lineno">10214</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.HOME:</div>
<div class="line"><a name="l10215"></a><span class="lineno">10215</span>&#160;                        newVal = <span class="keyword">self</span>._valueMin();</div>
<div class="line"><a name="l10216"></a><span class="lineno">10216</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10217"></a><span class="lineno">10217</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.END:</div>
<div class="line"><a name="l10218"></a><span class="lineno">10218</span>&#160;                        newVal = <span class="keyword">self</span>._valueMax();</div>
<div class="line"><a name="l10219"></a><span class="lineno">10219</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10220"></a><span class="lineno">10220</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.PAGE_UP:</div>
<div class="line"><a name="l10221"></a><span class="lineno">10221</span>&#160;                        newVal = <span class="keyword">self</span>._trimAlignValue( curVal + ( (<span class="keyword">self</span>._valueMax() - <span class="keyword">self</span>._valueMin()) / numPages ) );</div>
<div class="line"><a name="l10222"></a><span class="lineno">10222</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10223"></a><span class="lineno">10223</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.PAGE_DOWN:</div>
<div class="line"><a name="l10224"></a><span class="lineno">10224</span>&#160;                        newVal = <span class="keyword">self</span>._trimAlignValue( curVal - ( (<span class="keyword">self</span>._valueMax() - <span class="keyword">self</span>._valueMin()) / numPages ) );</div>
<div class="line"><a name="l10225"></a><span class="lineno">10225</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10226"></a><span class="lineno">10226</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.UP:</div>
<div class="line"><a name="l10227"></a><span class="lineno">10227</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.RIGHT:</div>
<div class="line"><a name="l10228"></a><span class="lineno">10228</span>&#160;                        <span class="keywordflow">if</span> ( curVal === <span class="keyword">self</span>._valueMax() ) {</div>
<div class="line"><a name="l10229"></a><span class="lineno">10229</span>&#160;                            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10230"></a><span class="lineno">10230</span>&#160;                        }</div>
<div class="line"><a name="l10231"></a><span class="lineno">10231</span>&#160;                        newVal = <span class="keyword">self</span>._trimAlignValue( curVal + step );</div>
<div class="line"><a name="l10232"></a><span class="lineno">10232</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10233"></a><span class="lineno">10233</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.DOWN:</div>
<div class="line"><a name="l10234"></a><span class="lineno">10234</span>&#160;                    <span class="keywordflow">case</span> $.ui.keyCode.LEFT:</div>
<div class="line"><a name="l10235"></a><span class="lineno">10235</span>&#160;                        <span class="keywordflow">if</span> ( curVal === <span class="keyword">self</span>._valueMin() ) {</div>
<div class="line"><a name="l10236"></a><span class="lineno">10236</span>&#160;                            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10237"></a><span class="lineno">10237</span>&#160;                        }</div>
<div class="line"><a name="l10238"></a><span class="lineno">10238</span>&#160;                        newVal = <span class="keyword">self</span>._trimAlignValue( curVal - step );</div>
<div class="line"><a name="l10239"></a><span class="lineno">10239</span>&#160;                        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10240"></a><span class="lineno">10240</span>&#160;                }</div>
<div class="line"><a name="l10241"></a><span class="lineno">10241</span>&#160;    </div>
<div class="line"><a name="l10242"></a><span class="lineno">10242</span>&#160;                <span class="keyword">self</span>._slide( event, index, newVal );</div>
<div class="line"><a name="l10243"></a><span class="lineno">10243</span>&#160;            })</div>
<div class="line"><a name="l10244"></a><span class="lineno">10244</span>&#160;            .keyup(<span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10245"></a><span class="lineno">10245</span>&#160;                var index = $( this ).data( <span class="stringliteral">&quot;index.ui-slider-handle&quot;</span> );</div>
<div class="line"><a name="l10246"></a><span class="lineno">10246</span>&#160;    </div>
<div class="line"><a name="l10247"></a><span class="lineno">10247</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>._keySliding ) {</div>
<div class="line"><a name="l10248"></a><span class="lineno">10248</span>&#160;                    <span class="keyword">self</span>._keySliding = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10249"></a><span class="lineno">10249</span>&#160;                    <span class="keyword">self</span>._stop( event, index );</div>
<div class="line"><a name="l10250"></a><span class="lineno">10250</span>&#160;                    <span class="keyword">self</span>._change( event, index );</div>
<div class="line"><a name="l10251"></a><span class="lineno">10251</span>&#160;                    $( this ).removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l10252"></a><span class="lineno">10252</span>&#160;                }</div>
<div class="line"><a name="l10253"></a><span class="lineno">10253</span>&#160;    </div>
<div class="line"><a name="l10254"></a><span class="lineno">10254</span>&#160;            });</div>
<div class="line"><a name="l10255"></a><span class="lineno">10255</span>&#160;</div>
<div class="line"><a name="l10256"></a><span class="lineno">10256</span>&#160;        this._refreshValue();</div>
<div class="line"><a name="l10257"></a><span class="lineno">10257</span>&#160;</div>
<div class="line"><a name="l10258"></a><span class="lineno">10258</span>&#160;        this._animateOff = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10259"></a><span class="lineno">10259</span>&#160;    },</div>
<div class="line"><a name="l10260"></a><span class="lineno">10260</span>&#160;</div>
<div class="line"><a name="l10261"></a><span class="lineno">10261</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10262"></a><span class="lineno">10262</span>&#160;        this.handles.remove();</div>
<div class="line"><a name="l10263"></a><span class="lineno">10263</span>&#160;        this.range.remove();</div>
<div class="line"><a name="l10264"></a><span class="lineno">10264</span>&#160;</div>
<div class="line"><a name="l10265"></a><span class="lineno">10265</span>&#160;        this.element</div>
<div class="line"><a name="l10266"></a><span class="lineno">10266</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-slider&quot;</span> +</div>
<div class="line"><a name="l10267"></a><span class="lineno">10267</span>&#160;                <span class="stringliteral">&quot; ui-slider-horizontal&quot;</span> +</div>
<div class="line"><a name="l10268"></a><span class="lineno">10268</span>&#160;                <span class="stringliteral">&quot; ui-slider-vertical&quot;</span> +</div>
<div class="line"><a name="l10269"></a><span class="lineno">10269</span>&#160;                <span class="stringliteral">&quot; ui-slider-disabled&quot;</span> +</div>
<div class="line"><a name="l10270"></a><span class="lineno">10270</span>&#160;                <span class="stringliteral">&quot; ui-widget&quot;</span> +</div>
<div class="line"><a name="l10271"></a><span class="lineno">10271</span>&#160;                <span class="stringliteral">&quot; ui-widget-content&quot;</span> +</div>
<div class="line"><a name="l10272"></a><span class="lineno">10272</span>&#160;                <span class="stringliteral">&quot; ui-corner-all&quot;</span> )</div>
<div class="line"><a name="l10273"></a><span class="lineno">10273</span>&#160;            .removeData( <span class="stringliteral">&quot;slider&quot;</span> )</div>
<div class="line"><a name="l10274"></a><span class="lineno">10274</span>&#160;            .unbind( <span class="stringliteral">&quot;.slider&quot;</span> );</div>
<div class="line"><a name="l10275"></a><span class="lineno">10275</span>&#160;</div>
<div class="line"><a name="l10276"></a><span class="lineno">10276</span>&#160;        this._mouseDestroy();</div>
<div class="line"><a name="l10277"></a><span class="lineno">10277</span>&#160;</div>
<div class="line"><a name="l10278"></a><span class="lineno">10278</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l10279"></a><span class="lineno">10279</span>&#160;    },</div>
<div class="line"><a name="l10280"></a><span class="lineno">10280</span>&#160;</div>
<div class="line"><a name="l10281"></a><span class="lineno">10281</span>&#160;    _mouseCapture: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10282"></a><span class="lineno">10282</span>&#160;        var o = this.options,</div>
<div class="line"><a name="l10283"></a><span class="lineno">10283</span>&#160;            position,</div>
<div class="line"><a name="l10284"></a><span class="lineno">10284</span>&#160;            normValue,</div>
<div class="line"><a name="l10285"></a><span class="lineno">10285</span>&#160;            distance,</div>
<div class="line"><a name="l10286"></a><span class="lineno">10286</span>&#160;            closestHandle,</div>
<div class="line"><a name="l10287"></a><span class="lineno">10287</span>&#160;            <span class="keyword">self</span>,</div>
<div class="line"><a name="l10288"></a><span class="lineno">10288</span>&#160;            index,</div>
<div class="line"><a name="l10289"></a><span class="lineno">10289</span>&#160;            allowed,</div>
<div class="line"><a name="l10290"></a><span class="lineno">10290</span>&#160;            offset,</div>
<div class="line"><a name="l10291"></a><span class="lineno">10291</span>&#160;            mouseOverHandle;</div>
<div class="line"><a name="l10292"></a><span class="lineno">10292</span>&#160;</div>
<div class="line"><a name="l10293"></a><span class="lineno">10293</span>&#160;        <span class="keywordflow">if</span> ( o.disabled ) {</div>
<div class="line"><a name="l10294"></a><span class="lineno">10294</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l10295"></a><span class="lineno">10295</span>&#160;        }</div>
<div class="line"><a name="l10296"></a><span class="lineno">10296</span>&#160;</div>
<div class="line"><a name="l10297"></a><span class="lineno">10297</span>&#160;        this.elementSize = {</div>
<div class="line"><a name="l10298"></a><span class="lineno">10298</span>&#160;            width: this.element.outerWidth(),</div>
<div class="line"><a name="l10299"></a><span class="lineno">10299</span>&#160;            height: this.element.outerHeight()</div>
<div class="line"><a name="l10300"></a><span class="lineno">10300</span>&#160;        };</div>
<div class="line"><a name="l10301"></a><span class="lineno">10301</span>&#160;        this.elementOffset = this.element.offset();</div>
<div class="line"><a name="l10302"></a><span class="lineno">10302</span>&#160;</div>
<div class="line"><a name="l10303"></a><span class="lineno">10303</span>&#160;        position = { x: <span class="keyword">event</span>.pageX, y: <span class="keyword">event</span>.pageY };</div>
<div class="line"><a name="l10304"></a><span class="lineno">10304</span>&#160;        normValue = this._normValueFromMouse( position );</div>
<div class="line"><a name="l10305"></a><span class="lineno">10305</span>&#160;        distance = this._valueMax() - this._valueMin() + 1;</div>
<div class="line"><a name="l10306"></a><span class="lineno">10306</span>&#160;        <span class="keyword">self</span> = <span class="keyword">this</span>;</div>
<div class="line"><a name="l10307"></a><span class="lineno">10307</span>&#160;        this.handles.each(<span class="keyword">function</span>( i ) {</div>
<div class="line"><a name="l10308"></a><span class="lineno">10308</span>&#160;            var thisDistance = Math.abs( normValue - <span class="keyword">self</span>.values(i) );</div>
<div class="line"><a name="l10309"></a><span class="lineno">10309</span>&#160;            <span class="keywordflow">if</span> ( distance &gt; thisDistance ) {</div>
<div class="line"><a name="l10310"></a><span class="lineno">10310</span>&#160;                distance = thisDistance;</div>
<div class="line"><a name="l10311"></a><span class="lineno">10311</span>&#160;                closestHandle = $( this );</div>
<div class="line"><a name="l10312"></a><span class="lineno">10312</span>&#160;                index = i;</div>
<div class="line"><a name="l10313"></a><span class="lineno">10313</span>&#160;            }</div>
<div class="line"><a name="l10314"></a><span class="lineno">10314</span>&#160;        });</div>
<div class="line"><a name="l10315"></a><span class="lineno">10315</span>&#160;</div>
<div class="line"><a name="l10316"></a><span class="lineno">10316</span>&#160;        <span class="comment">// workaround for bug #3736 (if both handles of a range are at 0,</span></div>
<div class="line"><a name="l10317"></a><span class="lineno">10317</span>&#160;        <span class="comment">// the first is always used as the one with least distance,</span></div>
<div class="line"><a name="l10318"></a><span class="lineno">10318</span>&#160;        <span class="comment">// and moving it is obviously prevented by preventing negative ranges)</span></div>
<div class="line"><a name="l10319"></a><span class="lineno">10319</span>&#160;        <span class="keywordflow">if</span>( o.range === <span class="keyword">true</span> &amp;&amp; <span class="keyword">this</span>.values(1) === o.min ) {</div>
<div class="line"><a name="l10320"></a><span class="lineno">10320</span>&#160;            index += 1;</div>
<div class="line"><a name="l10321"></a><span class="lineno">10321</span>&#160;            closestHandle = $( this.handles[index] );</div>
<div class="line"><a name="l10322"></a><span class="lineno">10322</span>&#160;        }</div>
<div class="line"><a name="l10323"></a><span class="lineno">10323</span>&#160;</div>
<div class="line"><a name="l10324"></a><span class="lineno">10324</span>&#160;        allowed = this._start( event, index );</div>
<div class="line"><a name="l10325"></a><span class="lineno">10325</span>&#160;        <span class="keywordflow">if</span> ( allowed === <span class="keyword">false</span> ) {</div>
<div class="line"><a name="l10326"></a><span class="lineno">10326</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l10327"></a><span class="lineno">10327</span>&#160;        }</div>
<div class="line"><a name="l10328"></a><span class="lineno">10328</span>&#160;        this._mouseSliding = <span class="keyword">true</span>;</div>
<div class="line"><a name="l10329"></a><span class="lineno">10329</span>&#160;</div>
<div class="line"><a name="l10330"></a><span class="lineno">10330</span>&#160;        <span class="keyword">self</span>._handleIndex = index;</div>
<div class="line"><a name="l10331"></a><span class="lineno">10331</span>&#160;</div>
<div class="line"><a name="l10332"></a><span class="lineno">10332</span>&#160;        closestHandle</div>
<div class="line"><a name="l10333"></a><span class="lineno">10333</span>&#160;            .addClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> )</div>
<div class="line"><a name="l10334"></a><span class="lineno">10334</span>&#160;            .focus();</div>
<div class="line"><a name="l10335"></a><span class="lineno">10335</span>&#160;        </div>
<div class="line"><a name="l10336"></a><span class="lineno">10336</span>&#160;        offset = closestHandle.offset();</div>
<div class="line"><a name="l10337"></a><span class="lineno">10337</span>&#160;        mouseOverHandle = !$( <span class="keyword">event</span>.target ).parents().andSelf().is( <span class="stringliteral">&quot;.ui-slider-handle&quot;</span> );</div>
<div class="line"><a name="l10338"></a><span class="lineno">10338</span>&#160;        this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {</div>
<div class="line"><a name="l10339"></a><span class="lineno">10339</span>&#160;            left: <span class="keyword">event</span>.pageX - offset.left - ( closestHandle.width() / 2 ),</div>
<div class="line"><a name="l10340"></a><span class="lineno">10340</span>&#160;            top: event.pageY - offset.top -</div>
<div class="line"><a name="l10341"></a><span class="lineno">10341</span>&#160;                ( closestHandle.height() / 2 ) -</div>
<div class="line"><a name="l10342"></a><span class="lineno">10342</span>&#160;                ( parseInt( closestHandle.css(<span class="stringliteral">&quot;borderTopWidth&quot;</span>), 10 ) || 0 ) -</div>
<div class="line"><a name="l10343"></a><span class="lineno">10343</span>&#160;                ( parseInt( closestHandle.css(<span class="stringliteral">&quot;borderBottomWidth&quot;</span>), 10 ) || 0) +</div>
<div class="line"><a name="l10344"></a><span class="lineno">10344</span>&#160;                ( parseInt( closestHandle.css(<span class="stringliteral">&quot;marginTop&quot;</span>), 10 ) || 0)</div>
<div class="line"><a name="l10345"></a><span class="lineno">10345</span>&#160;        };</div>
<div class="line"><a name="l10346"></a><span class="lineno">10346</span>&#160;</div>
<div class="line"><a name="l10347"></a><span class="lineno">10347</span>&#160;        <span class="keywordflow">if</span> ( !this.handles.hasClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> ) ) {</div>
<div class="line"><a name="l10348"></a><span class="lineno">10348</span>&#160;            this._slide( event, index, normValue );</div>
<div class="line"><a name="l10349"></a><span class="lineno">10349</span>&#160;        }</div>
<div class="line"><a name="l10350"></a><span class="lineno">10350</span>&#160;        this._animateOff = <span class="keyword">true</span>;</div>
<div class="line"><a name="l10351"></a><span class="lineno">10351</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l10352"></a><span class="lineno">10352</span>&#160;    },</div>
<div class="line"><a name="l10353"></a><span class="lineno">10353</span>&#160;</div>
<div class="line"><a name="l10354"></a><span class="lineno">10354</span>&#160;    _mouseStart: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10355"></a><span class="lineno">10355</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l10356"></a><span class="lineno">10356</span>&#160;    },</div>
<div class="line"><a name="l10357"></a><span class="lineno">10357</span>&#160;</div>
<div class="line"><a name="l10358"></a><span class="lineno">10358</span>&#160;    _mouseDrag: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10359"></a><span class="lineno">10359</span>&#160;        var position = { x: <span class="keyword">event</span>.pageX, y: <span class="keyword">event</span>.pageY },</div>
<div class="line"><a name="l10360"></a><span class="lineno">10360</span>&#160;            normValue = this._normValueFromMouse( position );</div>
<div class="line"><a name="l10361"></a><span class="lineno">10361</span>&#160;        </div>
<div class="line"><a name="l10362"></a><span class="lineno">10362</span>&#160;        this._slide( event, this._handleIndex, normValue );</div>
<div class="line"><a name="l10363"></a><span class="lineno">10363</span>&#160;</div>
<div class="line"><a name="l10364"></a><span class="lineno">10364</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l10365"></a><span class="lineno">10365</span>&#160;    },</div>
<div class="line"><a name="l10366"></a><span class="lineno">10366</span>&#160;</div>
<div class="line"><a name="l10367"></a><span class="lineno">10367</span>&#160;    _mouseStop: <span class="keyword">function</span>( event ) {</div>
<div class="line"><a name="l10368"></a><span class="lineno">10368</span>&#160;        this.handles.removeClass( <span class="stringliteral">&quot;ui-state-active&quot;</span> );</div>
<div class="line"><a name="l10369"></a><span class="lineno">10369</span>&#160;        this._mouseSliding = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10370"></a><span class="lineno">10370</span>&#160;</div>
<div class="line"><a name="l10371"></a><span class="lineno">10371</span>&#160;        this._stop( event, this._handleIndex );</div>
<div class="line"><a name="l10372"></a><span class="lineno">10372</span>&#160;        this._change( event, this._handleIndex );</div>
<div class="line"><a name="l10373"></a><span class="lineno">10373</span>&#160;</div>
<div class="line"><a name="l10374"></a><span class="lineno">10374</span>&#160;        this._handleIndex = null;</div>
<div class="line"><a name="l10375"></a><span class="lineno">10375</span>&#160;        this._clickOffset = null;</div>
<div class="line"><a name="l10376"></a><span class="lineno">10376</span>&#160;        this._animateOff = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10377"></a><span class="lineno">10377</span>&#160;</div>
<div class="line"><a name="l10378"></a><span class="lineno">10378</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l10379"></a><span class="lineno">10379</span>&#160;    },</div>
<div class="line"><a name="l10380"></a><span class="lineno">10380</span>&#160;    </div>
<div class="line"><a name="l10381"></a><span class="lineno">10381</span>&#160;    _detectOrientation: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10382"></a><span class="lineno">10382</span>&#160;        this.orientation = ( this.options.orientation === <span class="stringliteral">&quot;vertical&quot;</span> ) ? <span class="stringliteral">&quot;vertical&quot;</span> : <span class="stringliteral">&quot;horizontal&quot;</span>;</div>
<div class="line"><a name="l10383"></a><span class="lineno">10383</span>&#160;    },</div>
<div class="line"><a name="l10384"></a><span class="lineno">10384</span>&#160;</div>
<div class="line"><a name="l10385"></a><span class="lineno">10385</span>&#160;    _normValueFromMouse: <span class="keyword">function</span>( position ) {</div>
<div class="line"><a name="l10386"></a><span class="lineno">10386</span>&#160;        var pixelTotal,</div>
<div class="line"><a name="l10387"></a><span class="lineno">10387</span>&#160;            pixelMouse,</div>
<div class="line"><a name="l10388"></a><span class="lineno">10388</span>&#160;            percentMouse,</div>
<div class="line"><a name="l10389"></a><span class="lineno">10389</span>&#160;            valueTotal,</div>
<div class="line"><a name="l10390"></a><span class="lineno">10390</span>&#160;            valueMouse;</div>
<div class="line"><a name="l10391"></a><span class="lineno">10391</span>&#160;</div>
<div class="line"><a name="l10392"></a><span class="lineno">10392</span>&#160;        <span class="keywordflow">if</span> ( this.orientation === <span class="stringliteral">&quot;horizontal&quot;</span> ) {</div>
<div class="line"><a name="l10393"></a><span class="lineno">10393</span>&#160;            pixelTotal = this.elementSize.width;</div>
<div class="line"><a name="l10394"></a><span class="lineno">10394</span>&#160;            pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );</div>
<div class="line"><a name="l10395"></a><span class="lineno">10395</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10396"></a><span class="lineno">10396</span>&#160;            pixelTotal = this.elementSize.height;</div>
<div class="line"><a name="l10397"></a><span class="lineno">10397</span>&#160;            pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );</div>
<div class="line"><a name="l10398"></a><span class="lineno">10398</span>&#160;        }</div>
<div class="line"><a name="l10399"></a><span class="lineno">10399</span>&#160;</div>
<div class="line"><a name="l10400"></a><span class="lineno">10400</span>&#160;        percentMouse = ( pixelMouse / pixelTotal );</div>
<div class="line"><a name="l10401"></a><span class="lineno">10401</span>&#160;        <span class="keywordflow">if</span> ( percentMouse &gt; 1 ) {</div>
<div class="line"><a name="l10402"></a><span class="lineno">10402</span>&#160;            percentMouse = 1;</div>
<div class="line"><a name="l10403"></a><span class="lineno">10403</span>&#160;        }</div>
<div class="line"><a name="l10404"></a><span class="lineno">10404</span>&#160;        <span class="keywordflow">if</span> ( percentMouse &lt; 0 ) {</div>
<div class="line"><a name="l10405"></a><span class="lineno">10405</span>&#160;            percentMouse = 0;</div>
<div class="line"><a name="l10406"></a><span class="lineno">10406</span>&#160;        }</div>
<div class="line"><a name="l10407"></a><span class="lineno">10407</span>&#160;        <span class="keywordflow">if</span> ( this.orientation === <span class="stringliteral">&quot;vertical&quot;</span> ) {</div>
<div class="line"><a name="l10408"></a><span class="lineno">10408</span>&#160;            percentMouse = 1 - percentMouse;</div>
<div class="line"><a name="l10409"></a><span class="lineno">10409</span>&#160;        }</div>
<div class="line"><a name="l10410"></a><span class="lineno">10410</span>&#160;</div>
<div class="line"><a name="l10411"></a><span class="lineno">10411</span>&#160;        valueTotal = this._valueMax() - this._valueMin();</div>
<div class="line"><a name="l10412"></a><span class="lineno">10412</span>&#160;        valueMouse = this._valueMin() + percentMouse * valueTotal;</div>
<div class="line"><a name="l10413"></a><span class="lineno">10413</span>&#160;</div>
<div class="line"><a name="l10414"></a><span class="lineno">10414</span>&#160;        <span class="keywordflow">return</span> this._trimAlignValue( valueMouse );</div>
<div class="line"><a name="l10415"></a><span class="lineno">10415</span>&#160;    },</div>
<div class="line"><a name="l10416"></a><span class="lineno">10416</span>&#160;</div>
<div class="line"><a name="l10417"></a><span class="lineno">10417</span>&#160;    _start: <span class="keyword">function</span>( event, index ) {</div>
<div class="line"><a name="l10418"></a><span class="lineno">10418</span>&#160;        var uiHash = {</div>
<div class="line"><a name="l10419"></a><span class="lineno">10419</span>&#160;            handle: this.handles[ index ],</div>
<div class="line"><a name="l10420"></a><span class="lineno">10420</span>&#160;            value: this.value()</div>
<div class="line"><a name="l10421"></a><span class="lineno">10421</span>&#160;        };</div>
<div class="line"><a name="l10422"></a><span class="lineno">10422</span>&#160;        <span class="keywordflow">if</span> ( this.options.values &amp;&amp; <span class="keyword">this</span>.options.values.length ) {</div>
<div class="line"><a name="l10423"></a><span class="lineno">10423</span>&#160;            uiHash.value = this.values( index );</div>
<div class="line"><a name="l10424"></a><span class="lineno">10424</span>&#160;            uiHash.values = this.values();</div>
<div class="line"><a name="l10425"></a><span class="lineno">10425</span>&#160;        }</div>
<div class="line"><a name="l10426"></a><span class="lineno">10426</span>&#160;        <span class="keywordflow">return</span> this._trigger( <span class="stringliteral">&quot;start&quot;</span>, event, uiHash );</div>
<div class="line"><a name="l10427"></a><span class="lineno">10427</span>&#160;    },</div>
<div class="line"><a name="l10428"></a><span class="lineno">10428</span>&#160;</div>
<div class="line"><a name="l10429"></a><span class="lineno">10429</span>&#160;    _slide: <span class="keyword">function</span>( event, index, newVal ) {</div>
<div class="line"><a name="l10430"></a><span class="lineno">10430</span>&#160;        var otherVal,</div>
<div class="line"><a name="l10431"></a><span class="lineno">10431</span>&#160;            newValues,</div>
<div class="line"><a name="l10432"></a><span class="lineno">10432</span>&#160;            allowed;</div>
<div class="line"><a name="l10433"></a><span class="lineno">10433</span>&#160;</div>
<div class="line"><a name="l10434"></a><span class="lineno">10434</span>&#160;        <span class="keywordflow">if</span> ( this.options.values &amp;&amp; <span class="keyword">this</span>.options.values.length ) {</div>
<div class="line"><a name="l10435"></a><span class="lineno">10435</span>&#160;            otherVal = this.values( index ? 0 : 1 );</div>
<div class="line"><a name="l10436"></a><span class="lineno">10436</span>&#160;</div>
<div class="line"><a name="l10437"></a><span class="lineno">10437</span>&#160;            <span class="keywordflow">if</span> ( ( this.options.values.length === 2 &amp;&amp; <span class="keyword">this</span>.options.range === <span class="keyword">true</span> ) &amp;&amp; </div>
<div class="line"><a name="l10438"></a><span class="lineno">10438</span>&#160;                    ( ( index === 0 &amp;&amp; newVal &gt; otherVal) || ( index === 1 &amp;&amp; newVal &lt; otherVal ) )</div>
<div class="line"><a name="l10439"></a><span class="lineno">10439</span>&#160;                ) {</div>
<div class="line"><a name="l10440"></a><span class="lineno">10440</span>&#160;                newVal = otherVal;</div>
<div class="line"><a name="l10441"></a><span class="lineno">10441</span>&#160;            }</div>
<div class="line"><a name="l10442"></a><span class="lineno">10442</span>&#160;</div>
<div class="line"><a name="l10443"></a><span class="lineno">10443</span>&#160;            <span class="keywordflow">if</span> ( newVal !== this.values( index ) ) {</div>
<div class="line"><a name="l10444"></a><span class="lineno">10444</span>&#160;                newValues = this.values();</div>
<div class="line"><a name="l10445"></a><span class="lineno">10445</span>&#160;                newValues[ index ] = newVal;</div>
<div class="line"><a name="l10446"></a><span class="lineno">10446</span>&#160;                <span class="comment">// A slide can be canceled by returning false from the slide callback</span></div>
<div class="line"><a name="l10447"></a><span class="lineno">10447</span>&#160;                allowed = this._trigger( <span class="stringliteral">&quot;slide&quot;</span>, event, {</div>
<div class="line"><a name="l10448"></a><span class="lineno">10448</span>&#160;                    handle: this.handles[ index ],</div>
<div class="line"><a name="l10449"></a><span class="lineno">10449</span>&#160;                    value: newVal,</div>
<div class="line"><a name="l10450"></a><span class="lineno">10450</span>&#160;                    values: newValues</div>
<div class="line"><a name="l10451"></a><span class="lineno">10451</span>&#160;                } );</div>
<div class="line"><a name="l10452"></a><span class="lineno">10452</span>&#160;                otherVal = this.values( index ? 0 : 1 );</div>
<div class="line"><a name="l10453"></a><span class="lineno">10453</span>&#160;                <span class="keywordflow">if</span> ( allowed !== <span class="keyword">false</span> ) {</div>
<div class="line"><a name="l10454"></a><span class="lineno">10454</span>&#160;                    this.values( index, newVal, <span class="keyword">true</span> );</div>
<div class="line"><a name="l10455"></a><span class="lineno">10455</span>&#160;                }</div>
<div class="line"><a name="l10456"></a><span class="lineno">10456</span>&#160;            }</div>
<div class="line"><a name="l10457"></a><span class="lineno">10457</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10458"></a><span class="lineno">10458</span>&#160;            <span class="keywordflow">if</span> ( newVal !== this.value() ) {</div>
<div class="line"><a name="l10459"></a><span class="lineno">10459</span>&#160;                <span class="comment">// A slide can be canceled by returning false from the slide callback</span></div>
<div class="line"><a name="l10460"></a><span class="lineno">10460</span>&#160;                allowed = this._trigger( <span class="stringliteral">&quot;slide&quot;</span>, event, {</div>
<div class="line"><a name="l10461"></a><span class="lineno">10461</span>&#160;                    handle: this.handles[ index ],</div>
<div class="line"><a name="l10462"></a><span class="lineno">10462</span>&#160;                    value: newVal</div>
<div class="line"><a name="l10463"></a><span class="lineno">10463</span>&#160;                } );</div>
<div class="line"><a name="l10464"></a><span class="lineno">10464</span>&#160;                <span class="keywordflow">if</span> ( allowed !== <span class="keyword">false</span> ) {</div>
<div class="line"><a name="l10465"></a><span class="lineno">10465</span>&#160;                    this.value( newVal );</div>
<div class="line"><a name="l10466"></a><span class="lineno">10466</span>&#160;                }</div>
<div class="line"><a name="l10467"></a><span class="lineno">10467</span>&#160;            }</div>
<div class="line"><a name="l10468"></a><span class="lineno">10468</span>&#160;        }</div>
<div class="line"><a name="l10469"></a><span class="lineno">10469</span>&#160;    },</div>
<div class="line"><a name="l10470"></a><span class="lineno">10470</span>&#160;</div>
<div class="line"><a name="l10471"></a><span class="lineno">10471</span>&#160;    _stop: <span class="keyword">function</span>( event, index ) {</div>
<div class="line"><a name="l10472"></a><span class="lineno">10472</span>&#160;        var uiHash = {</div>
<div class="line"><a name="l10473"></a><span class="lineno">10473</span>&#160;            handle: this.handles[ index ],</div>
<div class="line"><a name="l10474"></a><span class="lineno">10474</span>&#160;            value: this.value()</div>
<div class="line"><a name="l10475"></a><span class="lineno">10475</span>&#160;        };</div>
<div class="line"><a name="l10476"></a><span class="lineno">10476</span>&#160;        <span class="keywordflow">if</span> ( this.options.values &amp;&amp; <span class="keyword">this</span>.options.values.length ) {</div>
<div class="line"><a name="l10477"></a><span class="lineno">10477</span>&#160;            uiHash.value = this.values( index );</div>
<div class="line"><a name="l10478"></a><span class="lineno">10478</span>&#160;            uiHash.values = this.values();</div>
<div class="line"><a name="l10479"></a><span class="lineno">10479</span>&#160;        }</div>
<div class="line"><a name="l10480"></a><span class="lineno">10480</span>&#160;</div>
<div class="line"><a name="l10481"></a><span class="lineno">10481</span>&#160;        this._trigger( <span class="stringliteral">&quot;stop&quot;</span>, event, uiHash );</div>
<div class="line"><a name="l10482"></a><span class="lineno">10482</span>&#160;    },</div>
<div class="line"><a name="l10483"></a><span class="lineno">10483</span>&#160;</div>
<div class="line"><a name="l10484"></a><span class="lineno">10484</span>&#160;    _change: <span class="keyword">function</span>( event, index ) {</div>
<div class="line"><a name="l10485"></a><span class="lineno">10485</span>&#160;        <span class="keywordflow">if</span> ( !this._keySliding &amp;&amp; !this._mouseSliding ) {</div>
<div class="line"><a name="l10486"></a><span class="lineno">10486</span>&#160;            var uiHash = {</div>
<div class="line"><a name="l10487"></a><span class="lineno">10487</span>&#160;                handle: this.handles[ index ],</div>
<div class="line"><a name="l10488"></a><span class="lineno">10488</span>&#160;                value: this.value()</div>
<div class="line"><a name="l10489"></a><span class="lineno">10489</span>&#160;            };</div>
<div class="line"><a name="l10490"></a><span class="lineno">10490</span>&#160;            <span class="keywordflow">if</span> ( this.options.values &amp;&amp; <span class="keyword">this</span>.options.values.length ) {</div>
<div class="line"><a name="l10491"></a><span class="lineno">10491</span>&#160;                uiHash.value = this.values( index );</div>
<div class="line"><a name="l10492"></a><span class="lineno">10492</span>&#160;                uiHash.values = this.values();</div>
<div class="line"><a name="l10493"></a><span class="lineno">10493</span>&#160;            }</div>
<div class="line"><a name="l10494"></a><span class="lineno">10494</span>&#160;</div>
<div class="line"><a name="l10495"></a><span class="lineno">10495</span>&#160;            this._trigger( <span class="stringliteral">&quot;change&quot;</span>, event, uiHash );</div>
<div class="line"><a name="l10496"></a><span class="lineno">10496</span>&#160;        }</div>
<div class="line"><a name="l10497"></a><span class="lineno">10497</span>&#160;    },</div>
<div class="line"><a name="l10498"></a><span class="lineno">10498</span>&#160;</div>
<div class="line"><a name="l10499"></a><span class="lineno">10499</span>&#160;    value: <span class="keyword">function</span>( newValue ) {</div>
<div class="line"><a name="l10500"></a><span class="lineno">10500</span>&#160;        <span class="keywordflow">if</span> ( arguments.length ) {</div>
<div class="line"><a name="l10501"></a><span class="lineno">10501</span>&#160;            this.options.value = this._trimAlignValue( newValue );</div>
<div class="line"><a name="l10502"></a><span class="lineno">10502</span>&#160;            this._refreshValue();</div>
<div class="line"><a name="l10503"></a><span class="lineno">10503</span>&#160;            this._change( null, 0 );</div>
<div class="line"><a name="l10504"></a><span class="lineno">10504</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10505"></a><span class="lineno">10505</span>&#160;        }</div>
<div class="line"><a name="l10506"></a><span class="lineno">10506</span>&#160;</div>
<div class="line"><a name="l10507"></a><span class="lineno">10507</span>&#160;        <span class="keywordflow">return</span> this._value();</div>
<div class="line"><a name="l10508"></a><span class="lineno">10508</span>&#160;    },</div>
<div class="line"><a name="l10509"></a><span class="lineno">10509</span>&#160;</div>
<div class="line"><a name="l10510"></a><span class="lineno">10510</span>&#160;    values: <span class="keyword">function</span>( index, newValue ) {</div>
<div class="line"><a name="l10511"></a><span class="lineno">10511</span>&#160;        var vals,</div>
<div class="line"><a name="l10512"></a><span class="lineno">10512</span>&#160;            newValues,</div>
<div class="line"><a name="l10513"></a><span class="lineno">10513</span>&#160;            i;</div>
<div class="line"><a name="l10514"></a><span class="lineno">10514</span>&#160;</div>
<div class="line"><a name="l10515"></a><span class="lineno">10515</span>&#160;        <span class="keywordflow">if</span> ( arguments.length &gt; 1 ) {</div>
<div class="line"><a name="l10516"></a><span class="lineno">10516</span>&#160;            this.options.values[ index ] = this._trimAlignValue( newValue );</div>
<div class="line"><a name="l10517"></a><span class="lineno">10517</span>&#160;            this._refreshValue();</div>
<div class="line"><a name="l10518"></a><span class="lineno">10518</span>&#160;            this._change( null, index );</div>
<div class="line"><a name="l10519"></a><span class="lineno">10519</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10520"></a><span class="lineno">10520</span>&#160;        }</div>
<div class="line"><a name="l10521"></a><span class="lineno">10521</span>&#160;</div>
<div class="line"><a name="l10522"></a><span class="lineno">10522</span>&#160;        <span class="keywordflow">if</span> ( arguments.length ) {</div>
<div class="line"><a name="l10523"></a><span class="lineno">10523</span>&#160;            <span class="keywordflow">if</span> ( $.isArray( arguments[ 0 ] ) ) {</div>
<div class="line"><a name="l10524"></a><span class="lineno">10524</span>&#160;                vals = this.options.values;</div>
<div class="line"><a name="l10525"></a><span class="lineno">10525</span>&#160;                newValues = arguments[ 0 ];</div>
<div class="line"><a name="l10526"></a><span class="lineno">10526</span>&#160;                <span class="keywordflow">for</span> ( i = 0; i &lt; vals.length; i += 1 ) {</div>
<div class="line"><a name="l10527"></a><span class="lineno">10527</span>&#160;                    vals[ i ] = this._trimAlignValue( newValues[ i ] );</div>
<div class="line"><a name="l10528"></a><span class="lineno">10528</span>&#160;                    this._change( null, i );</div>
<div class="line"><a name="l10529"></a><span class="lineno">10529</span>&#160;                }</div>
<div class="line"><a name="l10530"></a><span class="lineno">10530</span>&#160;                this._refreshValue();</div>
<div class="line"><a name="l10531"></a><span class="lineno">10531</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10532"></a><span class="lineno">10532</span>&#160;                <span class="keywordflow">if</span> ( this.options.values &amp;&amp; <span class="keyword">this</span>.options.values.length ) {</div>
<div class="line"><a name="l10533"></a><span class="lineno">10533</span>&#160;                    <span class="keywordflow">return</span> this._values( index );</div>
<div class="line"><a name="l10534"></a><span class="lineno">10534</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10535"></a><span class="lineno">10535</span>&#160;                    <span class="keywordflow">return</span> this.value();</div>
<div class="line"><a name="l10536"></a><span class="lineno">10536</span>&#160;                }</div>
<div class="line"><a name="l10537"></a><span class="lineno">10537</span>&#160;            }</div>
<div class="line"><a name="l10538"></a><span class="lineno">10538</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10539"></a><span class="lineno">10539</span>&#160;            <span class="keywordflow">return</span> this._values();</div>
<div class="line"><a name="l10540"></a><span class="lineno">10540</span>&#160;        }</div>
<div class="line"><a name="l10541"></a><span class="lineno">10541</span>&#160;    },</div>
<div class="line"><a name="l10542"></a><span class="lineno">10542</span>&#160;</div>
<div class="line"><a name="l10543"></a><span class="lineno">10543</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l10544"></a><span class="lineno">10544</span>&#160;        var i,</div>
<div class="line"><a name="l10545"></a><span class="lineno">10545</span>&#160;            valsLength = 0;</div>
<div class="line"><a name="l10546"></a><span class="lineno">10546</span>&#160;</div>
<div class="line"><a name="l10547"></a><span class="lineno">10547</span>&#160;        <span class="keywordflow">if</span> ( $.isArray( this.options.values ) ) {</div>
<div class="line"><a name="l10548"></a><span class="lineno">10548</span>&#160;            valsLength = this.options.values.length;</div>
<div class="line"><a name="l10549"></a><span class="lineno">10549</span>&#160;        }</div>
<div class="line"><a name="l10550"></a><span class="lineno">10550</span>&#160;</div>
<div class="line"><a name="l10551"></a><span class="lineno">10551</span>&#160;        $.Widget.prototype._setOption.apply( <span class="keyword">this</span>, arguments );</div>
<div class="line"><a name="l10552"></a><span class="lineno">10552</span>&#160;</div>
<div class="line"><a name="l10553"></a><span class="lineno">10553</span>&#160;        <span class="keywordflow">switch</span> ( key ) {</div>
<div class="line"><a name="l10554"></a><span class="lineno">10554</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;disabled&quot;</span>:</div>
<div class="line"><a name="l10555"></a><span class="lineno">10555</span>&#160;                <span class="keywordflow">if</span> ( value ) {</div>
<div class="line"><a name="l10556"></a><span class="lineno">10556</span>&#160;                    this.handles.filter( <span class="stringliteral">&quot;.ui-state-focus&quot;</span> ).blur();</div>
<div class="line"><a name="l10557"></a><span class="lineno">10557</span>&#160;                    this.handles.removeClass( <span class="stringliteral">&quot;ui-state-hover&quot;</span> );</div>
<div class="line"><a name="l10558"></a><span class="lineno">10558</span>&#160;                    this.handles.propAttr( <span class="stringliteral">&quot;disabled&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l10559"></a><span class="lineno">10559</span>&#160;                    this.element.addClass( <span class="stringliteral">&quot;ui-disabled&quot;</span> );</div>
<div class="line"><a name="l10560"></a><span class="lineno">10560</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10561"></a><span class="lineno">10561</span>&#160;                    this.handles.propAttr( <span class="stringliteral">&quot;disabled&quot;</span>, <span class="keyword">false</span> );</div>
<div class="line"><a name="l10562"></a><span class="lineno">10562</span>&#160;                    this.element.removeClass( <span class="stringliteral">&quot;ui-disabled&quot;</span> );</div>
<div class="line"><a name="l10563"></a><span class="lineno">10563</span>&#160;                }</div>
<div class="line"><a name="l10564"></a><span class="lineno">10564</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10565"></a><span class="lineno">10565</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;orientation&quot;</span>:</div>
<div class="line"><a name="l10566"></a><span class="lineno">10566</span>&#160;                this._detectOrientation();</div>
<div class="line"><a name="l10567"></a><span class="lineno">10567</span>&#160;                this.element</div>
<div class="line"><a name="l10568"></a><span class="lineno">10568</span>&#160;                    .removeClass( <span class="stringliteral">&quot;ui-slider-horizontal ui-slider-vertical&quot;</span> )</div>
<div class="line"><a name="l10569"></a><span class="lineno">10569</span>&#160;                    .addClass( <span class="stringliteral">&quot;ui-slider-&quot;</span> + this.orientation );</div>
<div class="line"><a name="l10570"></a><span class="lineno">10570</span>&#160;                this._refreshValue();</div>
<div class="line"><a name="l10571"></a><span class="lineno">10571</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10572"></a><span class="lineno">10572</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;value&quot;</span>:</div>
<div class="line"><a name="l10573"></a><span class="lineno">10573</span>&#160;                this._animateOff = <span class="keyword">true</span>;</div>
<div class="line"><a name="l10574"></a><span class="lineno">10574</span>&#160;                this._refreshValue();</div>
<div class="line"><a name="l10575"></a><span class="lineno">10575</span>&#160;                this._change( null, 0 );</div>
<div class="line"><a name="l10576"></a><span class="lineno">10576</span>&#160;                this._animateOff = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10577"></a><span class="lineno">10577</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10578"></a><span class="lineno">10578</span>&#160;            <span class="keywordflow">case</span> <span class="stringliteral">&quot;values&quot;</span>:</div>
<div class="line"><a name="l10579"></a><span class="lineno">10579</span>&#160;                this._animateOff = <span class="keyword">true</span>;</div>
<div class="line"><a name="l10580"></a><span class="lineno">10580</span>&#160;                this._refreshValue();</div>
<div class="line"><a name="l10581"></a><span class="lineno">10581</span>&#160;                <span class="keywordflow">for</span> ( i = 0; i &lt; valsLength; i += 1 ) {</div>
<div class="line"><a name="l10582"></a><span class="lineno">10582</span>&#160;                    this._change( null, i );</div>
<div class="line"><a name="l10583"></a><span class="lineno">10583</span>&#160;                }</div>
<div class="line"><a name="l10584"></a><span class="lineno">10584</span>&#160;                this._animateOff = <span class="keyword">false</span>;</div>
<div class="line"><a name="l10585"></a><span class="lineno">10585</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l10586"></a><span class="lineno">10586</span>&#160;        }</div>
<div class="line"><a name="l10587"></a><span class="lineno">10587</span>&#160;    },</div>
<div class="line"><a name="l10588"></a><span class="lineno">10588</span>&#160;</div>
<div class="line"><a name="l10589"></a><span class="lineno">10589</span>&#160;    <span class="comment">//internal value getter</span></div>
<div class="line"><a name="l10590"></a><span class="lineno">10590</span>&#160;    <span class="comment">// _value() returns value trimmed by min and max, aligned by step</span></div>
<div class="line"><a name="l10591"></a><span class="lineno">10591</span>&#160;    _value: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10592"></a><span class="lineno">10592</span>&#160;        var val = this.options.value;</div>
<div class="line"><a name="l10593"></a><span class="lineno">10593</span>&#160;        val = this._trimAlignValue( val );</div>
<div class="line"><a name="l10594"></a><span class="lineno">10594</span>&#160;</div>
<div class="line"><a name="l10595"></a><span class="lineno">10595</span>&#160;        <span class="keywordflow">return</span> val;</div>
<div class="line"><a name="l10596"></a><span class="lineno">10596</span>&#160;    },</div>
<div class="line"><a name="l10597"></a><span class="lineno">10597</span>&#160;</div>
<div class="line"><a name="l10598"></a><span class="lineno">10598</span>&#160;    <span class="comment">//internal values getter</span></div>
<div class="line"><a name="l10599"></a><span class="lineno">10599</span>&#160;    <span class="comment">// _values() returns array of values trimmed by min and max, aligned by step</span></div>
<div class="line"><a name="l10600"></a><span class="lineno">10600</span>&#160;    <span class="comment">// _values( index ) returns single value trimmed by min and max, aligned by step</span></div>
<div class="line"><a name="l10601"></a><span class="lineno">10601</span>&#160;    _values: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l10602"></a><span class="lineno">10602</span>&#160;        var val,</div>
<div class="line"><a name="l10603"></a><span class="lineno">10603</span>&#160;            vals,</div>
<div class="line"><a name="l10604"></a><span class="lineno">10604</span>&#160;            i;</div>
<div class="line"><a name="l10605"></a><span class="lineno">10605</span>&#160;</div>
<div class="line"><a name="l10606"></a><span class="lineno">10606</span>&#160;        <span class="keywordflow">if</span> ( arguments.length ) {</div>
<div class="line"><a name="l10607"></a><span class="lineno">10607</span>&#160;            val = this.options.values[ index ];</div>
<div class="line"><a name="l10608"></a><span class="lineno">10608</span>&#160;            val = this._trimAlignValue( val );</div>
<div class="line"><a name="l10609"></a><span class="lineno">10609</span>&#160;</div>
<div class="line"><a name="l10610"></a><span class="lineno">10610</span>&#160;            <span class="keywordflow">return</span> val;</div>
<div class="line"><a name="l10611"></a><span class="lineno">10611</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10612"></a><span class="lineno">10612</span>&#160;            <span class="comment">// .slice() creates a copy of the array</span></div>
<div class="line"><a name="l10613"></a><span class="lineno">10613</span>&#160;            <span class="comment">// this copy gets trimmed by min and max and then returned</span></div>
<div class="line"><a name="l10614"></a><span class="lineno">10614</span>&#160;            vals = this.options.values.slice();</div>
<div class="line"><a name="l10615"></a><span class="lineno">10615</span>&#160;            <span class="keywordflow">for</span> ( i = 0; i &lt; vals.length; i+= 1) {</div>
<div class="line"><a name="l10616"></a><span class="lineno">10616</span>&#160;                vals[ i ] = this._trimAlignValue( vals[ i ] );</div>
<div class="line"><a name="l10617"></a><span class="lineno">10617</span>&#160;            }</div>
<div class="line"><a name="l10618"></a><span class="lineno">10618</span>&#160;</div>
<div class="line"><a name="l10619"></a><span class="lineno">10619</span>&#160;            <span class="keywordflow">return</span> vals;</div>
<div class="line"><a name="l10620"></a><span class="lineno">10620</span>&#160;        }</div>
<div class="line"><a name="l10621"></a><span class="lineno">10621</span>&#160;    },</div>
<div class="line"><a name="l10622"></a><span class="lineno">10622</span>&#160;    </div>
<div class="line"><a name="l10623"></a><span class="lineno">10623</span>&#160;    <span class="comment">// returns the step-aligned value that val is closest to, between (inclusive) min and max</span></div>
<div class="line"><a name="l10624"></a><span class="lineno">10624</span>&#160;    _trimAlignValue: <span class="keyword">function</span>( val ) {</div>
<div class="line"><a name="l10625"></a><span class="lineno">10625</span>&#160;        <span class="keywordflow">if</span> ( val &lt;= this._valueMin() ) {</div>
<div class="line"><a name="l10626"></a><span class="lineno">10626</span>&#160;            <span class="keywordflow">return</span> this._valueMin();</div>
<div class="line"><a name="l10627"></a><span class="lineno">10627</span>&#160;        }</div>
<div class="line"><a name="l10628"></a><span class="lineno">10628</span>&#160;        <span class="keywordflow">if</span> ( val &gt;= this._valueMax() ) {</div>
<div class="line"><a name="l10629"></a><span class="lineno">10629</span>&#160;            <span class="keywordflow">return</span> this._valueMax();</div>
<div class="line"><a name="l10630"></a><span class="lineno">10630</span>&#160;        }</div>
<div class="line"><a name="l10631"></a><span class="lineno">10631</span>&#160;        var step = ( this.options.step &gt; 0 ) ? this.options.step : 1,</div>
<div class="line"><a name="l10632"></a><span class="lineno">10632</span>&#160;            valModStep = (val - <span class="keyword">this</span>._valueMin()) % step,</div>
<div class="line"><a name="l10633"></a><span class="lineno">10633</span>&#160;            alignValue = val - valModStep;</div>
<div class="line"><a name="l10634"></a><span class="lineno">10634</span>&#160;</div>
<div class="line"><a name="l10635"></a><span class="lineno">10635</span>&#160;        <span class="keywordflow">if</span> ( Math.abs(valModStep) * 2 &gt;= step ) {</div>
<div class="line"><a name="l10636"></a><span class="lineno">10636</span>&#160;            alignValue += ( valModStep &gt; 0 ) ? step : ( -step );</div>
<div class="line"><a name="l10637"></a><span class="lineno">10637</span>&#160;        }</div>
<div class="line"><a name="l10638"></a><span class="lineno">10638</span>&#160;</div>
<div class="line"><a name="l10639"></a><span class="lineno">10639</span>&#160;        <span class="comment">// Since JavaScript has problems with large floats, round</span></div>
<div class="line"><a name="l10640"></a><span class="lineno">10640</span>&#160;        <span class="comment">// the final value to 5 digits after the decimal point (see #4124)</span></div>
<div class="line"><a name="l10641"></a><span class="lineno">10641</span>&#160;        <span class="keywordflow">return</span> parseFloat( alignValue.toFixed(5) );</div>
<div class="line"><a name="l10642"></a><span class="lineno">10642</span>&#160;    },</div>
<div class="line"><a name="l10643"></a><span class="lineno">10643</span>&#160;</div>
<div class="line"><a name="l10644"></a><span class="lineno">10644</span>&#160;    _valueMin: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10645"></a><span class="lineno">10645</span>&#160;        <span class="keywordflow">return</span> this.options.min;</div>
<div class="line"><a name="l10646"></a><span class="lineno">10646</span>&#160;    },</div>
<div class="line"><a name="l10647"></a><span class="lineno">10647</span>&#160;</div>
<div class="line"><a name="l10648"></a><span class="lineno">10648</span>&#160;    _valueMax: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10649"></a><span class="lineno">10649</span>&#160;        <span class="keywordflow">return</span> this.options.max;</div>
<div class="line"><a name="l10650"></a><span class="lineno">10650</span>&#160;    },</div>
<div class="line"><a name="l10651"></a><span class="lineno">10651</span>&#160;    </div>
<div class="line"><a name="l10652"></a><span class="lineno">10652</span>&#160;    _refreshValue: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10653"></a><span class="lineno">10653</span>&#160;        var oRange = this.options.range,</div>
<div class="line"><a name="l10654"></a><span class="lineno">10654</span>&#160;            o = this.options,</div>
<div class="line"><a name="l10655"></a><span class="lineno">10655</span>&#160;            <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l10656"></a><span class="lineno">10656</span>&#160;            animate = ( !this._animateOff ) ? o.animate : <span class="keyword">false</span>,</div>
<div class="line"><a name="l10657"></a><span class="lineno">10657</span>&#160;            valPercent,</div>
<div class="line"><a name="l10658"></a><span class="lineno">10658</span>&#160;            _set = {},</div>
<div class="line"><a name="l10659"></a><span class="lineno">10659</span>&#160;            lastValPercent,</div>
<div class="line"><a name="l10660"></a><span class="lineno">10660</span>&#160;            value,</div>
<div class="line"><a name="l10661"></a><span class="lineno">10661</span>&#160;            valueMin,</div>
<div class="line"><a name="l10662"></a><span class="lineno">10662</span>&#160;            valueMax;</div>
<div class="line"><a name="l10663"></a><span class="lineno">10663</span>&#160;</div>
<div class="line"><a name="l10664"></a><span class="lineno">10664</span>&#160;        <span class="keywordflow">if</span> ( this.options.values &amp;&amp; <span class="keyword">this</span>.options.values.length ) {</div>
<div class="line"><a name="l10665"></a><span class="lineno">10665</span>&#160;            this.handles.each(<span class="keyword">function</span>( i, j ) {</div>
<div class="line"><a name="l10666"></a><span class="lineno">10666</span>&#160;                valPercent = ( <span class="keyword">self</span>.values(i) - <span class="keyword">self</span>._valueMin() ) / ( <span class="keyword">self</span>._valueMax() - <span class="keyword">self</span>._valueMin() ) * 100;</div>
<div class="line"><a name="l10667"></a><span class="lineno">10667</span>&#160;                _set[ <span class="keyword">self</span>.orientation === <span class="stringliteral">&quot;horizontal&quot;</span> ? <span class="stringliteral">&quot;left&quot;</span> : <span class="stringliteral">&quot;bottom&quot;</span> ] = valPercent + <span class="stringliteral">&quot;%&quot;</span>;</div>
<div class="line"><a name="l10668"></a><span class="lineno">10668</span>&#160;                $( this ).stop( 1, 1 )[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( _set, o.animate );</div>
<div class="line"><a name="l10669"></a><span class="lineno">10669</span>&#160;                <span class="keywordflow">if</span> ( <span class="keyword">self</span>.options.range === <span class="keyword">true</span> ) {</div>
<div class="line"><a name="l10670"></a><span class="lineno">10670</span>&#160;                    <span class="keywordflow">if</span> ( <span class="keyword">self</span>.orientation === <span class="stringliteral">&quot;horizontal&quot;</span> ) {</div>
<div class="line"><a name="l10671"></a><span class="lineno">10671</span>&#160;                        <span class="keywordflow">if</span> ( i === 0 ) {</div>
<div class="line"><a name="l10672"></a><span class="lineno">10672</span>&#160;                            <span class="keyword">self</span>.range.stop( 1, 1 )[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { left: valPercent + <span class="stringliteral">&quot;%&quot;</span> }, o.animate );</div>
<div class="line"><a name="l10673"></a><span class="lineno">10673</span>&#160;                        }</div>
<div class="line"><a name="l10674"></a><span class="lineno">10674</span>&#160;                        <span class="keywordflow">if</span> ( i === 1 ) {</div>
<div class="line"><a name="l10675"></a><span class="lineno">10675</span>&#160;                            <span class="keyword">self</span>.range[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { width: ( valPercent - lastValPercent ) + <span class="stringliteral">&quot;%&quot;</span> }, { queue: <span class="keyword">false</span>, duration: o.animate } );</div>
<div class="line"><a name="l10676"></a><span class="lineno">10676</span>&#160;                        }</div>
<div class="line"><a name="l10677"></a><span class="lineno">10677</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10678"></a><span class="lineno">10678</span>&#160;                        <span class="keywordflow">if</span> ( i === 0 ) {</div>
<div class="line"><a name="l10679"></a><span class="lineno">10679</span>&#160;                            <span class="keyword">self</span>.range.stop( 1, 1 )[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { bottom: ( valPercent ) + <span class="stringliteral">&quot;%&quot;</span> }, o.animate );</div>
<div class="line"><a name="l10680"></a><span class="lineno">10680</span>&#160;                        }</div>
<div class="line"><a name="l10681"></a><span class="lineno">10681</span>&#160;                        <span class="keywordflow">if</span> ( i === 1 ) {</div>
<div class="line"><a name="l10682"></a><span class="lineno">10682</span>&#160;                            <span class="keyword">self</span>.range[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { height: ( valPercent - lastValPercent ) + <span class="stringliteral">&quot;%&quot;</span> }, { queue: <span class="keyword">false</span>, duration: o.animate } );</div>
<div class="line"><a name="l10683"></a><span class="lineno">10683</span>&#160;                        }</div>
<div class="line"><a name="l10684"></a><span class="lineno">10684</span>&#160;                    }</div>
<div class="line"><a name="l10685"></a><span class="lineno">10685</span>&#160;                }</div>
<div class="line"><a name="l10686"></a><span class="lineno">10686</span>&#160;                lastValPercent = valPercent;</div>
<div class="line"><a name="l10687"></a><span class="lineno">10687</span>&#160;            });</div>
<div class="line"><a name="l10688"></a><span class="lineno">10688</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10689"></a><span class="lineno">10689</span>&#160;            value = this.value();</div>
<div class="line"><a name="l10690"></a><span class="lineno">10690</span>&#160;            valueMin = this._valueMin();</div>
<div class="line"><a name="l10691"></a><span class="lineno">10691</span>&#160;            valueMax = this._valueMax();</div>
<div class="line"><a name="l10692"></a><span class="lineno">10692</span>&#160;            valPercent = ( valueMax !== valueMin ) ?</div>
<div class="line"><a name="l10693"></a><span class="lineno">10693</span>&#160;                    ( value - valueMin ) / ( valueMax - valueMin ) * 100 :</div>
<div class="line"><a name="l10694"></a><span class="lineno">10694</span>&#160;                    0;</div>
<div class="line"><a name="l10695"></a><span class="lineno">10695</span>&#160;            _set[ <span class="keyword">self</span>.orientation === <span class="stringliteral">&quot;horizontal&quot;</span> ? <span class="stringliteral">&quot;left&quot;</span> : <span class="stringliteral">&quot;bottom&quot;</span> ] = valPercent + <span class="stringliteral">&quot;%&quot;</span>;</div>
<div class="line"><a name="l10696"></a><span class="lineno">10696</span>&#160;            this.handle.stop( 1, 1 )[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( _set, o.animate );</div>
<div class="line"><a name="l10697"></a><span class="lineno">10697</span>&#160;</div>
<div class="line"><a name="l10698"></a><span class="lineno">10698</span>&#160;            <span class="keywordflow">if</span> ( oRange === <span class="stringliteral">&quot;min&quot;</span> &amp;&amp; this.orientation === <span class="stringliteral">&quot;horizontal&quot;</span> ) {</div>
<div class="line"><a name="l10699"></a><span class="lineno">10699</span>&#160;                this.range.stop( 1, 1 )[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { width: valPercent + <span class="stringliteral">&quot;%&quot;</span> }, o.animate );</div>
<div class="line"><a name="l10700"></a><span class="lineno">10700</span>&#160;            }</div>
<div class="line"><a name="l10701"></a><span class="lineno">10701</span>&#160;            <span class="keywordflow">if</span> ( oRange === <span class="stringliteral">&quot;max&quot;</span> &amp;&amp; this.orientation === <span class="stringliteral">&quot;horizontal&quot;</span> ) {</div>
<div class="line"><a name="l10702"></a><span class="lineno">10702</span>&#160;                this.range[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { width: ( 100 - valPercent ) + <span class="stringliteral">&quot;%&quot;</span> }, { queue: <span class="keyword">false</span>, duration: o.animate } );</div>
<div class="line"><a name="l10703"></a><span class="lineno">10703</span>&#160;            }</div>
<div class="line"><a name="l10704"></a><span class="lineno">10704</span>&#160;            <span class="keywordflow">if</span> ( oRange === <span class="stringliteral">&quot;min&quot;</span> &amp;&amp; this.orientation === <span class="stringliteral">&quot;vertical&quot;</span> ) {</div>
<div class="line"><a name="l10705"></a><span class="lineno">10705</span>&#160;                this.range.stop( 1, 1 )[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { height: valPercent + <span class="stringliteral">&quot;%&quot;</span> }, o.animate );</div>
<div class="line"><a name="l10706"></a><span class="lineno">10706</span>&#160;            }</div>
<div class="line"><a name="l10707"></a><span class="lineno">10707</span>&#160;            <span class="keywordflow">if</span> ( oRange === <span class="stringliteral">&quot;max&quot;</span> &amp;&amp; this.orientation === <span class="stringliteral">&quot;vertical&quot;</span> ) {</div>
<div class="line"><a name="l10708"></a><span class="lineno">10708</span>&#160;                this.range[ animate ? <span class="stringliteral">&quot;animate&quot;</span> : <span class="stringliteral">&quot;css&quot;</span> ]( { height: ( 100 - valPercent ) + <span class="stringliteral">&quot;%&quot;</span> }, { queue: <span class="keyword">false</span>, duration: o.animate } );</div>
<div class="line"><a name="l10709"></a><span class="lineno">10709</span>&#160;            }</div>
<div class="line"><a name="l10710"></a><span class="lineno">10710</span>&#160;        }</div>
<div class="line"><a name="l10711"></a><span class="lineno">10711</span>&#160;    }</div>
<div class="line"><a name="l10712"></a><span class="lineno">10712</span>&#160;</div>
<div class="line"><a name="l10713"></a><span class="lineno">10713</span>&#160;});</div>
<div class="line"><a name="l10714"></a><span class="lineno">10714</span>&#160;</div>
<div class="line"><a name="l10715"></a><span class="lineno">10715</span>&#160;$.extend( $.ui.slider, {</div>
<div class="line"><a name="l10716"></a><span class="lineno">10716</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l10717"></a><span class="lineno">10717</span>&#160;});</div>
<div class="line"><a name="l10718"></a><span class="lineno">10718</span>&#160;</div>
<div class="line"><a name="l10719"></a><span class="lineno">10719</span>&#160;}(jQuery));</div>
<div class="line"><a name="l10720"></a><span class="lineno">10720</span>&#160;</div>
<div class="line"><a name="l10721"></a><span class="lineno">10721</span>&#160;(<span class="keyword">function</span>( $, undefined ) {</div>
<div class="line"><a name="l10722"></a><span class="lineno">10722</span>&#160;</div>
<div class="line"><a name="l10723"></a><span class="lineno">10723</span>&#160;var tabId = 0,</div>
<div class="line"><a name="l10724"></a><span class="lineno">10724</span>&#160;    listId = 0;</div>
<div class="line"><a name="l10725"></a><span class="lineno">10725</span>&#160;</div>
<div class="line"><a name="l10726"></a><span class="lineno">10726</span>&#160;<span class="keyword">function</span> getNextTabId() {</div>
<div class="line"><a name="l10727"></a><span class="lineno">10727</span>&#160;    <span class="keywordflow">return</span> ++tabId;</div>
<div class="line"><a name="l10728"></a><span class="lineno">10728</span>&#160;}</div>
<div class="line"><a name="l10729"></a><span class="lineno">10729</span>&#160;</div>
<div class="line"><a name="l10730"></a><span class="lineno">10730</span>&#160;<span class="keyword">function</span> getNextListId() {</div>
<div class="line"><a name="l10731"></a><span class="lineno">10731</span>&#160;    <span class="keywordflow">return</span> ++listId;</div>
<div class="line"><a name="l10732"></a><span class="lineno">10732</span>&#160;}</div>
<div class="line"><a name="l10733"></a><span class="lineno">10733</span>&#160;</div>
<div class="line"><a name="l10734"></a><span class="lineno">10734</span>&#160;$.widget( <span class="stringliteral">&quot;ui.tabs&quot;</span>, {</div>
<div class="line"><a name="l10735"></a><span class="lineno">10735</span>&#160;    options: {</div>
<div class="line"><a name="l10736"></a><span class="lineno">10736</span>&#160;        add: null,</div>
<div class="line"><a name="l10737"></a><span class="lineno">10737</span>&#160;        ajaxOptions: null,</div>
<div class="line"><a name="l10738"></a><span class="lineno">10738</span>&#160;        cache: <span class="keyword">false</span>,</div>
<div class="line"><a name="l10739"></a><span class="lineno">10739</span>&#160;        cookie: null, <span class="comment">// e.g. { expires: 7, path: &#39;/&#39;, domain: &#39;jquery.com&#39;, secure: true }</span></div>
<div class="line"><a name="l10740"></a><span class="lineno">10740</span>&#160;        collapsible: <span class="keyword">false</span>,</div>
<div class="line"><a name="l10741"></a><span class="lineno">10741</span>&#160;        disable: null,</div>
<div class="line"><a name="l10742"></a><span class="lineno">10742</span>&#160;        disabled: [],</div>
<div class="line"><a name="l10743"></a><span class="lineno">10743</span>&#160;        enable: null,</div>
<div class="line"><a name="l10744"></a><span class="lineno">10744</span>&#160;        <span class="keyword">event</span>: <span class="stringliteral">&quot;click&quot;</span>,</div>
<div class="line"><a name="l10745"></a><span class="lineno">10745</span>&#160;        fx: null, <span class="comment">// e.g. { height: &#39;toggle&#39;, opacity: &#39;toggle&#39;, duration: 200 }</span></div>
<div class="line"><a name="l10746"></a><span class="lineno">10746</span>&#160;        idPrefix: <span class="stringliteral">&quot;ui-tabs-&quot;</span>,</div>
<div class="line"><a name="l10747"></a><span class="lineno">10747</span>&#160;        load: null,</div>
<div class="line"><a name="l10748"></a><span class="lineno">10748</span>&#160;        panelTemplate: <span class="stringliteral">&quot;&lt;div&gt;&lt;/div&gt;&quot;</span>,</div>
<div class="line"><a name="l10749"></a><span class="lineno">10749</span>&#160;        <span class="keyword">remove</span>: null,</div>
<div class="line"><a name="l10750"></a><span class="lineno">10750</span>&#160;        select: null,</div>
<div class="line"><a name="l10751"></a><span class="lineno">10751</span>&#160;        show: null,</div>
<div class="line"><a name="l10752"></a><span class="lineno">10752</span>&#160;        spinner: <span class="stringliteral">&quot;&lt;em&gt;Loading&amp;#8230;&lt;/em&gt;&quot;</span>,</div>
<div class="line"><a name="l10753"></a><span class="lineno">10753</span>&#160;        tabTemplate: <span class="stringliteral">&quot;&lt;li&gt;&lt;a href=&#39;#{href}&#39;&gt;&lt;span&gt;#{label}&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&quot;</span></div>
<div class="line"><a name="l10754"></a><span class="lineno">10754</span>&#160;    },</div>
<div class="line"><a name="l10755"></a><span class="lineno">10755</span>&#160;</div>
<div class="line"><a name="l10756"></a><span class="lineno">10756</span>&#160;    _create: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10757"></a><span class="lineno">10757</span>&#160;        this._tabify( <span class="keyword">true</span> );</div>
<div class="line"><a name="l10758"></a><span class="lineno">10758</span>&#160;    },</div>
<div class="line"><a name="l10759"></a><span class="lineno">10759</span>&#160;</div>
<div class="line"><a name="l10760"></a><span class="lineno">10760</span>&#160;    _setOption: <span class="keyword">function</span>( key, value ) {</div>
<div class="line"><a name="l10761"></a><span class="lineno">10761</span>&#160;        <span class="keywordflow">if</span> ( key == <span class="stringliteral">&quot;selected&quot;</span> ) {</div>
<div class="line"><a name="l10762"></a><span class="lineno">10762</span>&#160;            <span class="keywordflow">if</span> (this.options.collapsible &amp;&amp; value == <span class="keyword">this</span>.options.selected ) {</div>
<div class="line"><a name="l10763"></a><span class="lineno">10763</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l10764"></a><span class="lineno">10764</span>&#160;            }</div>
<div class="line"><a name="l10765"></a><span class="lineno">10765</span>&#160;            this.select( value );</div>
<div class="line"><a name="l10766"></a><span class="lineno">10766</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10767"></a><span class="lineno">10767</span>&#160;            this.options[ key ] = value;</div>
<div class="line"><a name="l10768"></a><span class="lineno">10768</span>&#160;            this._tabify();</div>
<div class="line"><a name="l10769"></a><span class="lineno">10769</span>&#160;        }</div>
<div class="line"><a name="l10770"></a><span class="lineno">10770</span>&#160;    },</div>
<div class="line"><a name="l10771"></a><span class="lineno">10771</span>&#160;</div>
<div class="line"><a name="l10772"></a><span class="lineno">10772</span>&#160;    _tabId: <span class="keyword">function</span>( a ) {</div>
<div class="line"><a name="l10773"></a><span class="lineno">10773</span>&#160;        <span class="keywordflow">return</span> a.title &amp;&amp; a.title.replace( /\s/g, <span class="stringliteral">&quot;_&quot;</span> ).replace( /[^\w\u00c0-\uFFFF-]/g, <span class="stringliteral">&quot;&quot;</span> ) ||</div>
<div class="line"><a name="l10774"></a><span class="lineno">10774</span>&#160;            this.options.idPrefix + getNextTabId();</div>
<div class="line"><a name="l10775"></a><span class="lineno">10775</span>&#160;    },</div>
<div class="line"><a name="l10776"></a><span class="lineno">10776</span>&#160;</div>
<div class="line"><a name="l10777"></a><span class="lineno">10777</span>&#160;    _sanitizeSelector: <span class="keyword">function</span>( hash ) {</div>
<div class="line"><a name="l10778"></a><span class="lineno">10778</span>&#160;        <span class="comment">// we need this because an id may contain a &quot;:&quot;</span></div>
<div class="line"><a name="l10779"></a><span class="lineno">10779</span>&#160;        <span class="keywordflow">return</span> hash.replace( /:/g, <span class="stringliteral">&quot;\\:&quot;</span> );</div>
<div class="line"><a name="l10780"></a><span class="lineno">10780</span>&#160;    },</div>
<div class="line"><a name="l10781"></a><span class="lineno">10781</span>&#160;</div>
<div class="line"><a name="l10782"></a><span class="lineno">10782</span>&#160;    _cookie: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10783"></a><span class="lineno">10783</span>&#160;        var cookie = this.cookie ||</div>
<div class="line"><a name="l10784"></a><span class="lineno">10784</span>&#160;            ( this.cookie = this.options.cookie.name || <span class="stringliteral">&quot;ui-tabs-&quot;</span> + getNextListId() );</div>
<div class="line"><a name="l10785"></a><span class="lineno">10785</span>&#160;        <span class="keywordflow">return</span> $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) );</div>
<div class="line"><a name="l10786"></a><span class="lineno">10786</span>&#160;    },</div>
<div class="line"><a name="l10787"></a><span class="lineno">10787</span>&#160;</div>
<div class="line"><a name="l10788"></a><span class="lineno">10788</span>&#160;    _ui: <span class="keyword">function</span>( tab, panel ) {</div>
<div class="line"><a name="l10789"></a><span class="lineno">10789</span>&#160;        <span class="keywordflow">return</span> {</div>
<div class="line"><a name="l10790"></a><span class="lineno">10790</span>&#160;            tab: tab,</div>
<div class="line"><a name="l10791"></a><span class="lineno">10791</span>&#160;            panel: panel,</div>
<div class="line"><a name="l10792"></a><span class="lineno">10792</span>&#160;            index: this.anchors.index( tab )</div>
<div class="line"><a name="l10793"></a><span class="lineno">10793</span>&#160;        };</div>
<div class="line"><a name="l10794"></a><span class="lineno">10794</span>&#160;    },</div>
<div class="line"><a name="l10795"></a><span class="lineno">10795</span>&#160;</div>
<div class="line"><a name="l10796"></a><span class="lineno">10796</span>&#160;    _cleanup: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10797"></a><span class="lineno">10797</span>&#160;        <span class="comment">// restore all former loading tabs labels</span></div>
<div class="line"><a name="l10798"></a><span class="lineno">10798</span>&#160;        this.lis.filter( <span class="stringliteral">&quot;.ui-state-processing&quot;</span> )</div>
<div class="line"><a name="l10799"></a><span class="lineno">10799</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-state-processing&quot;</span> )</div>
<div class="line"><a name="l10800"></a><span class="lineno">10800</span>&#160;            .find( <span class="stringliteral">&quot;span:data(label.tabs)&quot;</span> )</div>
<div class="line"><a name="l10801"></a><span class="lineno">10801</span>&#160;                .each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l10802"></a><span class="lineno">10802</span>&#160;                    var el = $( this );</div>
<div class="line"><a name="l10803"></a><span class="lineno">10803</span>&#160;                    el.html( el.data( <span class="stringliteral">&quot;label.tabs&quot;</span> ) ).removeData( <span class="stringliteral">&quot;label.tabs&quot;</span> );</div>
<div class="line"><a name="l10804"></a><span class="lineno">10804</span>&#160;                });</div>
<div class="line"><a name="l10805"></a><span class="lineno">10805</span>&#160;    },</div>
<div class="line"><a name="l10806"></a><span class="lineno">10806</span>&#160;</div>
<div class="line"><a name="l10807"></a><span class="lineno">10807</span>&#160;    _tabify: <span class="keyword">function</span>( init ) {</div>
<div class="line"><a name="l10808"></a><span class="lineno">10808</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l10809"></a><span class="lineno">10809</span>&#160;            o = this.options,</div>
<div class="line"><a name="l10810"></a><span class="lineno">10810</span>&#160;            fragmentId = /^#.+/; <span class="comment">// Safari 2 reports &#39;#&#39; for an empty hash</span></div>
<div class="line"><a name="l10811"></a><span class="lineno">10811</span>&#160;</div>
<div class="line"><a name="l10812"></a><span class="lineno">10812</span>&#160;        this.list = this.element.find( <span class="stringliteral">&quot;ol,ul&quot;</span> ).eq( 0 );</div>
<div class="line"><a name="l10813"></a><span class="lineno">10813</span>&#160;        this.lis = $( <span class="stringliteral">&quot; &gt; li:has(a[href])&quot;</span>, this.list );</div>
<div class="line"><a name="l10814"></a><span class="lineno">10814</span>&#160;        this.anchors = this.lis.map(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l10815"></a><span class="lineno">10815</span>&#160;            <span class="keywordflow">return</span> $( <span class="stringliteral">&quot;a&quot;</span>, this )[ 0 ];</div>
<div class="line"><a name="l10816"></a><span class="lineno">10816</span>&#160;        });</div>
<div class="line"><a name="l10817"></a><span class="lineno">10817</span>&#160;        this.panels = $( [] );</div>
<div class="line"><a name="l10818"></a><span class="lineno">10818</span>&#160;</div>
<div class="line"><a name="l10819"></a><span class="lineno">10819</span>&#160;        this.anchors.each(<span class="keyword">function</span>( i, a ) {</div>
<div class="line"><a name="l10820"></a><span class="lineno">10820</span>&#160;            var href = $( a ).attr( <span class="stringliteral">&quot;href&quot;</span> );</div>
<div class="line"><a name="l10821"></a><span class="lineno">10821</span>&#160;            <span class="comment">// For dynamically created HTML that contains a hash as href IE &lt; 8 expands</span></div>
<div class="line"><a name="l10822"></a><span class="lineno">10822</span>&#160;            <span class="comment">// such href to the full page url with hash and then misinterprets tab as ajax.</span></div>
<div class="line"><a name="l10823"></a><span class="lineno">10823</span>&#160;            <span class="comment">// Same consideration applies for an added tab with a fragment identifier</span></div>
<div class="line"><a name="l10824"></a><span class="lineno">10824</span>&#160;            <span class="comment">// since a[href=#fragment-identifier] does unexpectedly not match.</span></div>
<div class="line"><a name="l10825"></a><span class="lineno">10825</span>&#160;            <span class="comment">// Thus normalize href attribute...</span></div>
<div class="line"><a name="l10826"></a><span class="lineno">10826</span>&#160;            var hrefBase = href.split( <span class="stringliteral">&quot;#&quot;</span> )[ 0 ],</div>
<div class="line"><a name="l10827"></a><span class="lineno">10827</span>&#160;                baseEl;</div>
<div class="line"><a name="l10828"></a><span class="lineno">10828</span>&#160;            <span class="keywordflow">if</span> ( hrefBase &amp;&amp; ( hrefBase === location.toString().split( <span class="stringliteral">&quot;#&quot;</span> )[ 0 ] ||</div>
<div class="line"><a name="l10829"></a><span class="lineno">10829</span>&#160;                    ( baseEl = $( <span class="stringliteral">&quot;base&quot;</span> )[ 0 ]) &amp;&amp; hrefBase === baseEl.href ) ) {</div>
<div class="line"><a name="l10830"></a><span class="lineno">10830</span>&#160;                href = a.hash;</div>
<div class="line"><a name="l10831"></a><span class="lineno">10831</span>&#160;                a.href = href;</div>
<div class="line"><a name="l10832"></a><span class="lineno">10832</span>&#160;            }</div>
<div class="line"><a name="l10833"></a><span class="lineno">10833</span>&#160;</div>
<div class="line"><a name="l10834"></a><span class="lineno">10834</span>&#160;            <span class="comment">// inline tab</span></div>
<div class="line"><a name="l10835"></a><span class="lineno">10835</span>&#160;            <span class="keywordflow">if</span> ( fragmentId.test( href ) ) {</div>
<div class="line"><a name="l10836"></a><span class="lineno">10836</span>&#160;                <span class="keyword">self</span>.panels = <span class="keyword">self</span>.panels.add( <span class="keyword">self</span>.element.find( <span class="keyword">self</span>._sanitizeSelector( href ) ) );</div>
<div class="line"><a name="l10837"></a><span class="lineno">10837</span>&#160;            <span class="comment">// remote tab</span></div>
<div class="line"><a name="l10838"></a><span class="lineno">10838</span>&#160;            <span class="comment">// prevent loading the page itself if href is just &quot;#&quot;</span></div>
<div class="line"><a name="l10839"></a><span class="lineno">10839</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( href &amp;&amp; href !== <span class="stringliteral">&quot;#&quot;</span> ) {</div>
<div class="line"><a name="l10840"></a><span class="lineno">10840</span>&#160;                <span class="comment">// required for restore on destroy</span></div>
<div class="line"><a name="l10841"></a><span class="lineno">10841</span>&#160;                $.data( a, <span class="stringliteral">&quot;href.tabs&quot;</span>, href );</div>
<div class="line"><a name="l10842"></a><span class="lineno">10842</span>&#160;</div>
<div class="line"><a name="l10843"></a><span class="lineno">10843</span>&#160;                <span class="comment">// TODO until #3808 is fixed strip fragment identifier from url</span></div>
<div class="line"><a name="l10844"></a><span class="lineno">10844</span>&#160;                <span class="comment">// (IE fails to load from such url)</span></div>
<div class="line"><a name="l10845"></a><span class="lineno">10845</span>&#160;                $.data( a, <span class="stringliteral">&quot;load.tabs&quot;</span>, href.replace( /#.*$/, <span class="stringliteral">&quot;&quot;</span> ) );</div>
<div class="line"><a name="l10846"></a><span class="lineno">10846</span>&#160;</div>
<div class="line"><a name="l10847"></a><span class="lineno">10847</span>&#160;                var <span class="keywordtype">id</span> = <span class="keyword">self</span>._tabId( a );</div>
<div class="line"><a name="l10848"></a><span class="lineno">10848</span>&#160;                a.href = <span class="stringliteral">&quot;#&quot;</span> + id;</div>
<div class="line"><a name="l10849"></a><span class="lineno">10849</span>&#160;                var $panel = <span class="keyword">self</span>.element.find( <span class="stringliteral">&quot;#&quot;</span> + <span class="keywordtype">id</span> );</div>
<div class="line"><a name="l10850"></a><span class="lineno">10850</span>&#160;                <span class="keywordflow">if</span> ( !$panel.length ) {</div>
<div class="line"><a name="l10851"></a><span class="lineno">10851</span>&#160;                    $panel = $( o.panelTemplate )</div>
<div class="line"><a name="l10852"></a><span class="lineno">10852</span>&#160;                        .attr( <span class="stringliteral">&quot;id&quot;</span>, <span class="keywordtype">id</span> )</div>
<div class="line"><a name="l10853"></a><span class="lineno">10853</span>&#160;                        .addClass( <span class="stringliteral">&quot;ui-tabs-panel ui-widget-content ui-corner-bottom&quot;</span> )</div>
<div class="line"><a name="l10854"></a><span class="lineno">10854</span>&#160;                        .insertAfter( <span class="keyword">self</span>.panels[ i - 1 ] || <span class="keyword">self</span>.list );</div>
<div class="line"><a name="l10855"></a><span class="lineno">10855</span>&#160;                    $panel.data( <span class="stringliteral">&quot;destroy.tabs&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l10856"></a><span class="lineno">10856</span>&#160;                }</div>
<div class="line"><a name="l10857"></a><span class="lineno">10857</span>&#160;                <span class="keyword">self</span>.panels = <span class="keyword">self</span>.panels.add( $panel );</div>
<div class="line"><a name="l10858"></a><span class="lineno">10858</span>&#160;            <span class="comment">// invalid tab href</span></div>
<div class="line"><a name="l10859"></a><span class="lineno">10859</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10860"></a><span class="lineno">10860</span>&#160;                o.disabled.push( i );</div>
<div class="line"><a name="l10861"></a><span class="lineno">10861</span>&#160;            }</div>
<div class="line"><a name="l10862"></a><span class="lineno">10862</span>&#160;        });</div>
<div class="line"><a name="l10863"></a><span class="lineno">10863</span>&#160;</div>
<div class="line"><a name="l10864"></a><span class="lineno">10864</span>&#160;        <span class="comment">// initialization from scratch</span></div>
<div class="line"><a name="l10865"></a><span class="lineno">10865</span>&#160;        <span class="keywordflow">if</span> ( init ) {</div>
<div class="line"><a name="l10866"></a><span class="lineno">10866</span>&#160;            <span class="comment">// attach necessary classes for styling</span></div>
<div class="line"><a name="l10867"></a><span class="lineno">10867</span>&#160;            this.element.addClass( <span class="stringliteral">&quot;ui-tabs ui-widget ui-widget-content ui-corner-all&quot;</span> );</div>
<div class="line"><a name="l10868"></a><span class="lineno">10868</span>&#160;            this.list.addClass( <span class="stringliteral">&quot;ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;</span> );</div>
<div class="line"><a name="l10869"></a><span class="lineno">10869</span>&#160;            this.lis.addClass( <span class="stringliteral">&quot;ui-state-default ui-corner-top&quot;</span> );</div>
<div class="line"><a name="l10870"></a><span class="lineno">10870</span>&#160;            this.panels.addClass( <span class="stringliteral">&quot;ui-tabs-panel ui-widget-content ui-corner-bottom&quot;</span> );</div>
<div class="line"><a name="l10871"></a><span class="lineno">10871</span>&#160;</div>
<div class="line"><a name="l10872"></a><span class="lineno">10872</span>&#160;            <span class="comment">// Selected tab</span></div>
<div class="line"><a name="l10873"></a><span class="lineno">10873</span>&#160;            <span class="comment">// use &quot;selected&quot; option or try to retrieve:</span></div>
<div class="line"><a name="l10874"></a><span class="lineno">10874</span>&#160;            <span class="comment">// 1. from fragment identifier in url</span></div>
<div class="line"><a name="l10875"></a><span class="lineno">10875</span>&#160;            <span class="comment">// 2. from cookie</span></div>
<div class="line"><a name="l10876"></a><span class="lineno">10876</span>&#160;            <span class="comment">// 3. from selected class attribute on &lt;li&gt;</span></div>
<div class="line"><a name="l10877"></a><span class="lineno">10877</span>&#160;            <span class="keywordflow">if</span> ( o.selected === undefined ) {</div>
<div class="line"><a name="l10878"></a><span class="lineno">10878</span>&#160;                <span class="keywordflow">if</span> ( location.hash ) {</div>
<div class="line"><a name="l10879"></a><span class="lineno">10879</span>&#160;                    this.anchors.each(<span class="keyword">function</span>( i, a ) {</div>
<div class="line"><a name="l10880"></a><span class="lineno">10880</span>&#160;                        <span class="keywordflow">if</span> ( a.hash == location.hash ) {</div>
<div class="line"><a name="l10881"></a><span class="lineno">10881</span>&#160;                            o.selected = i;</div>
<div class="line"><a name="l10882"></a><span class="lineno">10882</span>&#160;                            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l10883"></a><span class="lineno">10883</span>&#160;                        }</div>
<div class="line"><a name="l10884"></a><span class="lineno">10884</span>&#160;                    });</div>
<div class="line"><a name="l10885"></a><span class="lineno">10885</span>&#160;                }</div>
<div class="line"><a name="l10886"></a><span class="lineno">10886</span>&#160;                <span class="keywordflow">if</span> ( typeof o.selected !== <span class="stringliteral">&quot;number&quot;</span> &amp;&amp; o.cookie ) {</div>
<div class="line"><a name="l10887"></a><span class="lineno">10887</span>&#160;                    o.selected = parseInt( <span class="keyword">self</span>._cookie(), 10 );</div>
<div class="line"><a name="l10888"></a><span class="lineno">10888</span>&#160;                }</div>
<div class="line"><a name="l10889"></a><span class="lineno">10889</span>&#160;                <span class="keywordflow">if</span> ( typeof o.selected !== <span class="stringliteral">&quot;number&quot;</span> &amp;&amp; <span class="keyword">this</span>.lis.filter( <span class="stringliteral">&quot;.ui-tabs-selected&quot;</span> ).length ) {</div>
<div class="line"><a name="l10890"></a><span class="lineno">10890</span>&#160;                    o.selected = this.lis.index( this.lis.filter( <span class="stringliteral">&quot;.ui-tabs-selected&quot;</span> ) );</div>
<div class="line"><a name="l10891"></a><span class="lineno">10891</span>&#160;                }</div>
<div class="line"><a name="l10892"></a><span class="lineno">10892</span>&#160;                o.selected = o.selected || ( this.lis.length ? 0 : -1 );</div>
<div class="line"><a name="l10893"></a><span class="lineno">10893</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( o.selected === null ) { <span class="comment">// usage of null is deprecated, TODO remove in next release</span></div>
<div class="line"><a name="l10894"></a><span class="lineno">10894</span>&#160;                o.selected = -1;</div>
<div class="line"><a name="l10895"></a><span class="lineno">10895</span>&#160;            }</div>
<div class="line"><a name="l10896"></a><span class="lineno">10896</span>&#160;</div>
<div class="line"><a name="l10897"></a><span class="lineno">10897</span>&#160;            <span class="comment">// sanity check - default to first tab...</span></div>
<div class="line"><a name="l10898"></a><span class="lineno">10898</span>&#160;            o.selected = ( ( o.selected &gt;= 0 &amp;&amp; this.anchors[ o.selected ] ) || o.selected &lt; 0 )</div>
<div class="line"><a name="l10899"></a><span class="lineno">10899</span>&#160;                ? o.selected</div>
<div class="line"><a name="l10900"></a><span class="lineno">10900</span>&#160;                : 0;</div>
<div class="line"><a name="l10901"></a><span class="lineno">10901</span>&#160;</div>
<div class="line"><a name="l10902"></a><span class="lineno">10902</span>&#160;            <span class="comment">// Take disabling tabs via class attribute from HTML</span></div>
<div class="line"><a name="l10903"></a><span class="lineno">10903</span>&#160;            <span class="comment">// into account and update option properly.</span></div>
<div class="line"><a name="l10904"></a><span class="lineno">10904</span>&#160;            <span class="comment">// A selected tab cannot become disabled.</span></div>
<div class="line"><a name="l10905"></a><span class="lineno">10905</span>&#160;            o.disabled = $.unique( o.disabled.concat(</div>
<div class="line"><a name="l10906"></a><span class="lineno">10906</span>&#160;                $.map( <span class="keyword">this</span>.lis.filter( <span class="stringliteral">&quot;.ui-state-disabled&quot;</span> ), <span class="keyword">function</span>( n, i ) {</div>
<div class="line"><a name="l10907"></a><span class="lineno">10907</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">self</span>.lis.index( n );</div>
<div class="line"><a name="l10908"></a><span class="lineno">10908</span>&#160;                })</div>
<div class="line"><a name="l10909"></a><span class="lineno">10909</span>&#160;            ) ).sort();</div>
<div class="line"><a name="l10910"></a><span class="lineno">10910</span>&#160;</div>
<div class="line"><a name="l10911"></a><span class="lineno">10911</span>&#160;            <span class="keywordflow">if</span> ( $.inArray( o.selected, o.disabled ) != -1 ) {</div>
<div class="line"><a name="l10912"></a><span class="lineno">10912</span>&#160;                o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 );</div>
<div class="line"><a name="l10913"></a><span class="lineno">10913</span>&#160;            }</div>
<div class="line"><a name="l10914"></a><span class="lineno">10914</span>&#160;</div>
<div class="line"><a name="l10915"></a><span class="lineno">10915</span>&#160;            <span class="comment">// highlight selected tab</span></div>
<div class="line"><a name="l10916"></a><span class="lineno">10916</span>&#160;            this.panels.addClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l10917"></a><span class="lineno">10917</span>&#160;            this.lis.removeClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l10918"></a><span class="lineno">10918</span>&#160;            <span class="comment">// check for length avoids error when initializing empty list</span></div>
<div class="line"><a name="l10919"></a><span class="lineno">10919</span>&#160;            <span class="keywordflow">if</span> ( o.selected &gt;= 0 &amp;&amp; <span class="keyword">this</span>.anchors.length ) {</div>
<div class="line"><a name="l10920"></a><span class="lineno">10920</span>&#160;                <span class="keyword">self</span>.element.find( <span class="keyword">self</span>._sanitizeSelector( <span class="keyword">self</span>.anchors[ o.selected ].hash ) ).removeClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l10921"></a><span class="lineno">10921</span>&#160;                this.lis.eq( o.selected ).addClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l10922"></a><span class="lineno">10922</span>&#160;</div>
<div class="line"><a name="l10923"></a><span class="lineno">10923</span>&#160;                <span class="comment">// seems to be expected behavior that the show callback is fired</span></div>
<div class="line"><a name="l10924"></a><span class="lineno">10924</span>&#160;                <span class="keyword">self</span>.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10925"></a><span class="lineno">10925</span>&#160;                    <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;show&quot;</span>, null,</div>
<div class="line"><a name="l10926"></a><span class="lineno">10926</span>&#160;                        <span class="keyword">self</span>._ui( <span class="keyword">self</span>.anchors[ o.selected ], <span class="keyword">self</span>.element.find( <span class="keyword">self</span>._sanitizeSelector( <span class="keyword">self</span>.anchors[ o.selected ].hash ) )[ 0 ] ) );</div>
<div class="line"><a name="l10927"></a><span class="lineno">10927</span>&#160;                });</div>
<div class="line"><a name="l10928"></a><span class="lineno">10928</span>&#160;</div>
<div class="line"><a name="l10929"></a><span class="lineno">10929</span>&#160;                this.load( o.selected );</div>
<div class="line"><a name="l10930"></a><span class="lineno">10930</span>&#160;            }</div>
<div class="line"><a name="l10931"></a><span class="lineno">10931</span>&#160;</div>
<div class="line"><a name="l10932"></a><span class="lineno">10932</span>&#160;            <span class="comment">// clean up to avoid memory leaks in certain versions of IE 6</span></div>
<div class="line"><a name="l10933"></a><span class="lineno">10933</span>&#160;            <span class="comment">// TODO: namespace this event</span></div>
<div class="line"><a name="l10934"></a><span class="lineno">10934</span>&#160;            $( window ).bind( <span class="stringliteral">&quot;unload&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10935"></a><span class="lineno">10935</span>&#160;                <span class="keyword">self</span>.lis.add( <span class="keyword">self</span>.anchors ).unbind( <span class="stringliteral">&quot;.tabs&quot;</span> );</div>
<div class="line"><a name="l10936"></a><span class="lineno">10936</span>&#160;                <span class="keyword">self</span>.lis = <span class="keyword">self</span>.anchors = <span class="keyword">self</span>.panels = null;</div>
<div class="line"><a name="l10937"></a><span class="lineno">10937</span>&#160;            });</div>
<div class="line"><a name="l10938"></a><span class="lineno">10938</span>&#160;        <span class="comment">// update selected after add/remove</span></div>
<div class="line"><a name="l10939"></a><span class="lineno">10939</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10940"></a><span class="lineno">10940</span>&#160;            o.selected = this.lis.index( this.lis.filter( <span class="stringliteral">&quot;.ui-tabs-selected&quot;</span> ) );</div>
<div class="line"><a name="l10941"></a><span class="lineno">10941</span>&#160;        }</div>
<div class="line"><a name="l10942"></a><span class="lineno">10942</span>&#160;</div>
<div class="line"><a name="l10943"></a><span class="lineno">10943</span>&#160;        <span class="comment">// update collapsible</span></div>
<div class="line"><a name="l10944"></a><span class="lineno">10944</span>&#160;        <span class="comment">// TODO: use .toggleClass()</span></div>
<div class="line"><a name="l10945"></a><span class="lineno">10945</span>&#160;        this.element[ o.collapsible ? <span class="stringliteral">&quot;addClass&quot;</span> : <span class="stringliteral">&quot;removeClass&quot;</span> ]( <span class="stringliteral">&quot;ui-tabs-collapsible&quot;</span> );</div>
<div class="line"><a name="l10946"></a><span class="lineno">10946</span>&#160;</div>
<div class="line"><a name="l10947"></a><span class="lineno">10947</span>&#160;        <span class="comment">// set or update cookie after init and add/remove respectively</span></div>
<div class="line"><a name="l10948"></a><span class="lineno">10948</span>&#160;        <span class="keywordflow">if</span> ( o.cookie ) {</div>
<div class="line"><a name="l10949"></a><span class="lineno">10949</span>&#160;            this._cookie( o.selected, o.cookie );</div>
<div class="line"><a name="l10950"></a><span class="lineno">10950</span>&#160;        }</div>
<div class="line"><a name="l10951"></a><span class="lineno">10951</span>&#160;</div>
<div class="line"><a name="l10952"></a><span class="lineno">10952</span>&#160;        <span class="comment">// disable tabs</span></div>
<div class="line"><a name="l10953"></a><span class="lineno">10953</span>&#160;        <span class="keywordflow">for</span> ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {</div>
<div class="line"><a name="l10954"></a><span class="lineno">10954</span>&#160;            $( li )[ $.inArray( i, o.disabled ) != -1 &amp;&amp;</div>
<div class="line"><a name="l10955"></a><span class="lineno">10955</span>&#160;                <span class="comment">// TODO: use .toggleClass()</span></div>
<div class="line"><a name="l10956"></a><span class="lineno">10956</span>&#160;                !$( li ).hasClass( <span class="stringliteral">&quot;ui-tabs-selected&quot;</span> ) ? <span class="stringliteral">&quot;addClass&quot;</span> : <span class="stringliteral">&quot;removeClass&quot;</span> ]( <span class="stringliteral">&quot;ui-state-disabled&quot;</span> );</div>
<div class="line"><a name="l10957"></a><span class="lineno">10957</span>&#160;        }</div>
<div class="line"><a name="l10958"></a><span class="lineno">10958</span>&#160;</div>
<div class="line"><a name="l10959"></a><span class="lineno">10959</span>&#160;        <span class="comment">// reset cache if switching from cached to not cached</span></div>
<div class="line"><a name="l10960"></a><span class="lineno">10960</span>&#160;        <span class="keywordflow">if</span> ( o.cache === <span class="keyword">false</span> ) {</div>
<div class="line"><a name="l10961"></a><span class="lineno">10961</span>&#160;            this.anchors.removeData( <span class="stringliteral">&quot;cache.tabs&quot;</span> );</div>
<div class="line"><a name="l10962"></a><span class="lineno">10962</span>&#160;        }</div>
<div class="line"><a name="l10963"></a><span class="lineno">10963</span>&#160;</div>
<div class="line"><a name="l10964"></a><span class="lineno">10964</span>&#160;        <span class="comment">// remove all handlers before, tabify may run on existing tabs after add or option change</span></div>
<div class="line"><a name="l10965"></a><span class="lineno">10965</span>&#160;        this.lis.add( this.anchors ).unbind( <span class="stringliteral">&quot;.tabs&quot;</span> );</div>
<div class="line"><a name="l10966"></a><span class="lineno">10966</span>&#160;</div>
<div class="line"><a name="l10967"></a><span class="lineno">10967</span>&#160;        <span class="keywordflow">if</span> ( o.event !== <span class="stringliteral">&quot;mouseover&quot;</span> ) {</div>
<div class="line"><a name="l10968"></a><span class="lineno">10968</span>&#160;            var addState = <span class="keyword">function</span>( state, el ) {</div>
<div class="line"><a name="l10969"></a><span class="lineno">10969</span>&#160;                <span class="keywordflow">if</span> ( el.is( <span class="stringliteral">&quot;:not(.ui-state-disabled)&quot;</span> ) ) {</div>
<div class="line"><a name="l10970"></a><span class="lineno">10970</span>&#160;                    el.addClass( <span class="stringliteral">&quot;ui-state-&quot;</span> + state );</div>
<div class="line"><a name="l10971"></a><span class="lineno">10971</span>&#160;                }</div>
<div class="line"><a name="l10972"></a><span class="lineno">10972</span>&#160;            };</div>
<div class="line"><a name="l10973"></a><span class="lineno">10973</span>&#160;            var removeState = <span class="keyword">function</span>( state, el ) {</div>
<div class="line"><a name="l10974"></a><span class="lineno">10974</span>&#160;                el.removeClass( <span class="stringliteral">&quot;ui-state-&quot;</span> + state );</div>
<div class="line"><a name="l10975"></a><span class="lineno">10975</span>&#160;            };</div>
<div class="line"><a name="l10976"></a><span class="lineno">10976</span>&#160;            this.lis.bind( <span class="stringliteral">&quot;mouseover.tabs&quot;</span> , <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10977"></a><span class="lineno">10977</span>&#160;                addState( <span class="stringliteral">&quot;hover&quot;</span>, $( <span class="keyword">this</span> ) );</div>
<div class="line"><a name="l10978"></a><span class="lineno">10978</span>&#160;            });</div>
<div class="line"><a name="l10979"></a><span class="lineno">10979</span>&#160;            this.lis.bind( <span class="stringliteral">&quot;mouseout.tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10980"></a><span class="lineno">10980</span>&#160;                removeState( <span class="stringliteral">&quot;hover&quot;</span>, $( <span class="keyword">this</span> ) );</div>
<div class="line"><a name="l10981"></a><span class="lineno">10981</span>&#160;            });</div>
<div class="line"><a name="l10982"></a><span class="lineno">10982</span>&#160;            this.anchors.bind( <span class="stringliteral">&quot;focus.tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10983"></a><span class="lineno">10983</span>&#160;                addState( <span class="stringliteral">&quot;focus&quot;</span>, $( <span class="keyword">this</span> ).closest( <span class="stringliteral">&quot;li&quot;</span> ) );</div>
<div class="line"><a name="l10984"></a><span class="lineno">10984</span>&#160;            });</div>
<div class="line"><a name="l10985"></a><span class="lineno">10985</span>&#160;            this.anchors.bind( <span class="stringliteral">&quot;blur.tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l10986"></a><span class="lineno">10986</span>&#160;                removeState( <span class="stringliteral">&quot;focus&quot;</span>, $( <span class="keyword">this</span> ).closest( <span class="stringliteral">&quot;li&quot;</span> ) );</div>
<div class="line"><a name="l10987"></a><span class="lineno">10987</span>&#160;            });</div>
<div class="line"><a name="l10988"></a><span class="lineno">10988</span>&#160;        }</div>
<div class="line"><a name="l10989"></a><span class="lineno">10989</span>&#160;</div>
<div class="line"><a name="l10990"></a><span class="lineno">10990</span>&#160;        <span class="comment">// set up animations</span></div>
<div class="line"><a name="l10991"></a><span class="lineno">10991</span>&#160;        var hideFx, showFx;</div>
<div class="line"><a name="l10992"></a><span class="lineno">10992</span>&#160;        <span class="keywordflow">if</span> ( o.fx ) {</div>
<div class="line"><a name="l10993"></a><span class="lineno">10993</span>&#160;            <span class="keywordflow">if</span> ( $.isArray( o.fx ) ) {</div>
<div class="line"><a name="l10994"></a><span class="lineno">10994</span>&#160;                hideFx = o.fx[ 0 ];</div>
<div class="line"><a name="l10995"></a><span class="lineno">10995</span>&#160;                showFx = o.fx[ 1 ];</div>
<div class="line"><a name="l10996"></a><span class="lineno">10996</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l10997"></a><span class="lineno">10997</span>&#160;                hideFx = showFx = o.fx;</div>
<div class="line"><a name="l10998"></a><span class="lineno">10998</span>&#160;            }</div>
<div class="line"><a name="l10999"></a><span class="lineno">10999</span>&#160;        }</div>
<div class="line"><a name="l11000"></a><span class="lineno">11000</span>&#160;</div>
<div class="line"><a name="l11001"></a><span class="lineno">11001</span>&#160;        <span class="comment">// Reset certain styles left over from animation</span></div>
<div class="line"><a name="l11002"></a><span class="lineno">11002</span>&#160;        <span class="comment">// and prevent IE&#39;s ClearType bug...</span></div>
<div class="line"><a name="l11003"></a><span class="lineno">11003</span>&#160;        <span class="keyword">function</span> resetStyle( $el, fx ) {</div>
<div class="line"><a name="l11004"></a><span class="lineno">11004</span>&#160;            $el.css( <span class="stringliteral">&quot;display&quot;</span>, <span class="stringliteral">&quot;&quot;</span> );</div>
<div class="line"><a name="l11005"></a><span class="lineno">11005</span>&#160;            <span class="keywordflow">if</span> ( !$.support.opacity &amp;&amp; fx.opacity ) {</div>
<div class="line"><a name="l11006"></a><span class="lineno">11006</span>&#160;                $el[ 0 ].style.removeAttribute( <span class="stringliteral">&quot;filter&quot;</span> );</div>
<div class="line"><a name="l11007"></a><span class="lineno">11007</span>&#160;            }</div>
<div class="line"><a name="l11008"></a><span class="lineno">11008</span>&#160;        }</div>
<div class="line"><a name="l11009"></a><span class="lineno">11009</span>&#160;</div>
<div class="line"><a name="l11010"></a><span class="lineno">11010</span>&#160;        <span class="comment">// Show a tab...</span></div>
<div class="line"><a name="l11011"></a><span class="lineno">11011</span>&#160;        var showTab = showFx</div>
<div class="line"><a name="l11012"></a><span class="lineno">11012</span>&#160;            ? <span class="keyword">function</span>( clicked, $show ) {</div>
<div class="line"><a name="l11013"></a><span class="lineno">11013</span>&#160;                $( clicked ).closest( <span class="stringliteral">&quot;li&quot;</span> ).addClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l11014"></a><span class="lineno">11014</span>&#160;                $show.hide().removeClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> ) <span class="comment">// avoid flicker that way</span></div>
<div class="line"><a name="l11015"></a><span class="lineno">11015</span>&#160;                    .animate( showFx, showFx.duration || <span class="stringliteral">&quot;normal&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11016"></a><span class="lineno">11016</span>&#160;                        resetStyle( $show, showFx );</div>
<div class="line"><a name="l11017"></a><span class="lineno">11017</span>&#160;                        <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;show&quot;</span>, null, <span class="keyword">self</span>._ui( clicked, $show[ 0 ] ) );</div>
<div class="line"><a name="l11018"></a><span class="lineno">11018</span>&#160;                    });</div>
<div class="line"><a name="l11019"></a><span class="lineno">11019</span>&#160;            }</div>
<div class="line"><a name="l11020"></a><span class="lineno">11020</span>&#160;            : <span class="keyword">function</span>( clicked, $show ) {</div>
<div class="line"><a name="l11021"></a><span class="lineno">11021</span>&#160;                $( clicked ).closest( <span class="stringliteral">&quot;li&quot;</span> ).addClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l11022"></a><span class="lineno">11022</span>&#160;                $show.removeClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l11023"></a><span class="lineno">11023</span>&#160;                <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;show&quot;</span>, null, <span class="keyword">self</span>._ui( clicked, $show[ 0 ] ) );</div>
<div class="line"><a name="l11024"></a><span class="lineno">11024</span>&#160;            };</div>
<div class="line"><a name="l11025"></a><span class="lineno">11025</span>&#160;</div>
<div class="line"><a name="l11026"></a><span class="lineno">11026</span>&#160;        <span class="comment">// Hide a tab, $show is optional...</span></div>
<div class="line"><a name="l11027"></a><span class="lineno">11027</span>&#160;        var hideTab = hideFx</div>
<div class="line"><a name="l11028"></a><span class="lineno">11028</span>&#160;            ? <span class="keyword">function</span>( clicked, $hide ) {</div>
<div class="line"><a name="l11029"></a><span class="lineno">11029</span>&#160;                $hide.animate( hideFx, hideFx.duration || <span class="stringliteral">&quot;normal&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11030"></a><span class="lineno">11030</span>&#160;                    <span class="keyword">self</span>.lis.removeClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l11031"></a><span class="lineno">11031</span>&#160;                    $hide.addClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l11032"></a><span class="lineno">11032</span>&#160;                    resetStyle( $hide, hideFx );</div>
<div class="line"><a name="l11033"></a><span class="lineno">11033</span>&#160;                    <span class="keyword">self</span>.element.dequeue( <span class="stringliteral">&quot;tabs&quot;</span> );</div>
<div class="line"><a name="l11034"></a><span class="lineno">11034</span>&#160;                });</div>
<div class="line"><a name="l11035"></a><span class="lineno">11035</span>&#160;            }</div>
<div class="line"><a name="l11036"></a><span class="lineno">11036</span>&#160;            : <span class="keyword">function</span>( clicked, $hide, $show ) {</div>
<div class="line"><a name="l11037"></a><span class="lineno">11037</span>&#160;                <span class="keyword">self</span>.lis.removeClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l11038"></a><span class="lineno">11038</span>&#160;                $hide.addClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l11039"></a><span class="lineno">11039</span>&#160;                <span class="keyword">self</span>.element.dequeue( <span class="stringliteral">&quot;tabs&quot;</span> );</div>
<div class="line"><a name="l11040"></a><span class="lineno">11040</span>&#160;            };</div>
<div class="line"><a name="l11041"></a><span class="lineno">11041</span>&#160;</div>
<div class="line"><a name="l11042"></a><span class="lineno">11042</span>&#160;        <span class="comment">// attach tab event handler, unbind to avoid duplicates from former tabifying...</span></div>
<div class="line"><a name="l11043"></a><span class="lineno">11043</span>&#160;        this.anchors.bind( o.event + <span class="stringliteral">&quot;.tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11044"></a><span class="lineno">11044</span>&#160;            var el = <span class="keyword">this</span>,</div>
<div class="line"><a name="l11045"></a><span class="lineno">11045</span>&#160;                $li = $(el).closest( <span class="stringliteral">&quot;li&quot;</span> ),</div>
<div class="line"><a name="l11046"></a><span class="lineno">11046</span>&#160;                $hide = <span class="keyword">self</span>.panels.filter( <span class="stringliteral">&quot;:not(.ui-tabs-hide)&quot;</span> ),</div>
<div class="line"><a name="l11047"></a><span class="lineno">11047</span>&#160;                $show = <span class="keyword">self</span>.element.find( <span class="keyword">self</span>._sanitizeSelector( el.hash ) );</div>
<div class="line"><a name="l11048"></a><span class="lineno">11048</span>&#160;</div>
<div class="line"><a name="l11049"></a><span class="lineno">11049</span>&#160;            <span class="comment">// If tab is already selected and not collapsible or tab disabled or</span></div>
<div class="line"><a name="l11050"></a><span class="lineno">11050</span>&#160;            <span class="comment">// or is already loading or click callback returns false stop here.</span></div>
<div class="line"><a name="l11051"></a><span class="lineno">11051</span>&#160;            <span class="comment">// Check if click handler returns false last so that it is not executed</span></div>
<div class="line"><a name="l11052"></a><span class="lineno">11052</span>&#160;            <span class="comment">// for a disabled or loading tab!</span></div>
<div class="line"><a name="l11053"></a><span class="lineno">11053</span>&#160;            <span class="keywordflow">if</span> ( ( $li.hasClass( <span class="stringliteral">&quot;ui-tabs-selected&quot;</span> ) &amp;&amp; !o.collapsible) ||</div>
<div class="line"><a name="l11054"></a><span class="lineno">11054</span>&#160;                $li.hasClass( <span class="stringliteral">&quot;ui-state-disabled&quot;</span> ) ||</div>
<div class="line"><a name="l11055"></a><span class="lineno">11055</span>&#160;                $li.hasClass( <span class="stringliteral">&quot;ui-state-processing&quot;</span> ) ||</div>
<div class="line"><a name="l11056"></a><span class="lineno">11056</span>&#160;                <span class="keyword">self</span>.panels.filter( <span class="stringliteral">&quot;:animated&quot;</span> ).length ||</div>
<div class="line"><a name="l11057"></a><span class="lineno">11057</span>&#160;                <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;select&quot;</span>, null, <span class="keyword">self</span>._ui( <span class="keyword">this</span>, $show[ 0 ] ) ) === false ) {</div>
<div class="line"><a name="l11058"></a><span class="lineno">11058</span>&#160;                this.blur();</div>
<div class="line"><a name="l11059"></a><span class="lineno">11059</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l11060"></a><span class="lineno">11060</span>&#160;            }</div>
<div class="line"><a name="l11061"></a><span class="lineno">11061</span>&#160;</div>
<div class="line"><a name="l11062"></a><span class="lineno">11062</span>&#160;            o.selected = <span class="keyword">self</span>.anchors.index( <span class="keyword">this</span> );</div>
<div class="line"><a name="l11063"></a><span class="lineno">11063</span>&#160;</div>
<div class="line"><a name="l11064"></a><span class="lineno">11064</span>&#160;            <span class="keyword">self</span>.abort();</div>
<div class="line"><a name="l11065"></a><span class="lineno">11065</span>&#160;</div>
<div class="line"><a name="l11066"></a><span class="lineno">11066</span>&#160;            <span class="comment">// if tab may be closed</span></div>
<div class="line"><a name="l11067"></a><span class="lineno">11067</span>&#160;            <span class="keywordflow">if</span> ( o.collapsible ) {</div>
<div class="line"><a name="l11068"></a><span class="lineno">11068</span>&#160;                <span class="keywordflow">if</span> ( $li.hasClass( <span class="stringliteral">&quot;ui-tabs-selected&quot;</span> ) ) {</div>
<div class="line"><a name="l11069"></a><span class="lineno">11069</span>&#160;                    o.selected = -1;</div>
<div class="line"><a name="l11070"></a><span class="lineno">11070</span>&#160;</div>
<div class="line"><a name="l11071"></a><span class="lineno">11071</span>&#160;                    <span class="keywordflow">if</span> ( o.cookie ) {</div>
<div class="line"><a name="l11072"></a><span class="lineno">11072</span>&#160;                        <span class="keyword">self</span>._cookie( o.selected, o.cookie );</div>
<div class="line"><a name="l11073"></a><span class="lineno">11073</span>&#160;                    }</div>
<div class="line"><a name="l11074"></a><span class="lineno">11074</span>&#160;</div>
<div class="line"><a name="l11075"></a><span class="lineno">11075</span>&#160;                    <span class="keyword">self</span>.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11076"></a><span class="lineno">11076</span>&#160;                        hideTab( el, $hide );</div>
<div class="line"><a name="l11077"></a><span class="lineno">11077</span>&#160;                    }).dequeue( <span class="stringliteral">&quot;tabs&quot;</span> );</div>
<div class="line"><a name="l11078"></a><span class="lineno">11078</span>&#160;</div>
<div class="line"><a name="l11079"></a><span class="lineno">11079</span>&#160;                    this.blur();</div>
<div class="line"><a name="l11080"></a><span class="lineno">11080</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l11081"></a><span class="lineno">11081</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( !$hide.length ) {</div>
<div class="line"><a name="l11082"></a><span class="lineno">11082</span>&#160;                    <span class="keywordflow">if</span> ( o.cookie ) {</div>
<div class="line"><a name="l11083"></a><span class="lineno">11083</span>&#160;                        <span class="keyword">self</span>._cookie( o.selected, o.cookie );</div>
<div class="line"><a name="l11084"></a><span class="lineno">11084</span>&#160;                    }</div>
<div class="line"><a name="l11085"></a><span class="lineno">11085</span>&#160;</div>
<div class="line"><a name="l11086"></a><span class="lineno">11086</span>&#160;                    <span class="keyword">self</span>.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11087"></a><span class="lineno">11087</span>&#160;                        showTab( el, $show );</div>
<div class="line"><a name="l11088"></a><span class="lineno">11088</span>&#160;                    });</div>
<div class="line"><a name="l11089"></a><span class="lineno">11089</span>&#160;</div>
<div class="line"><a name="l11090"></a><span class="lineno">11090</span>&#160;                    <span class="comment">// TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171</span></div>
<div class="line"><a name="l11091"></a><span class="lineno">11091</span>&#160;                    <span class="keyword">self</span>.load( <span class="keyword">self</span>.anchors.index( <span class="keyword">this</span> ) );</div>
<div class="line"><a name="l11092"></a><span class="lineno">11092</span>&#160;</div>
<div class="line"><a name="l11093"></a><span class="lineno">11093</span>&#160;                    this.blur();</div>
<div class="line"><a name="l11094"></a><span class="lineno">11094</span>&#160;                    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l11095"></a><span class="lineno">11095</span>&#160;                }</div>
<div class="line"><a name="l11096"></a><span class="lineno">11096</span>&#160;            }</div>
<div class="line"><a name="l11097"></a><span class="lineno">11097</span>&#160;</div>
<div class="line"><a name="l11098"></a><span class="lineno">11098</span>&#160;            <span class="keywordflow">if</span> ( o.cookie ) {</div>
<div class="line"><a name="l11099"></a><span class="lineno">11099</span>&#160;                <span class="keyword">self</span>._cookie( o.selected, o.cookie );</div>
<div class="line"><a name="l11100"></a><span class="lineno">11100</span>&#160;            }</div>
<div class="line"><a name="l11101"></a><span class="lineno">11101</span>&#160;</div>
<div class="line"><a name="l11102"></a><span class="lineno">11102</span>&#160;            <span class="comment">// show new tab</span></div>
<div class="line"><a name="l11103"></a><span class="lineno">11103</span>&#160;            <span class="keywordflow">if</span> ( $show.length ) {</div>
<div class="line"><a name="l11104"></a><span class="lineno">11104</span>&#160;                <span class="keywordflow">if</span> ( $hide.length ) {</div>
<div class="line"><a name="l11105"></a><span class="lineno">11105</span>&#160;                    <span class="keyword">self</span>.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11106"></a><span class="lineno">11106</span>&#160;                        hideTab( el, $hide );</div>
<div class="line"><a name="l11107"></a><span class="lineno">11107</span>&#160;                    });</div>
<div class="line"><a name="l11108"></a><span class="lineno">11108</span>&#160;                }</div>
<div class="line"><a name="l11109"></a><span class="lineno">11109</span>&#160;                <span class="keyword">self</span>.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11110"></a><span class="lineno">11110</span>&#160;                    showTab( el, $show );</div>
<div class="line"><a name="l11111"></a><span class="lineno">11111</span>&#160;                });</div>
<div class="line"><a name="l11112"></a><span class="lineno">11112</span>&#160;</div>
<div class="line"><a name="l11113"></a><span class="lineno">11113</span>&#160;                <span class="keyword">self</span>.load( <span class="keyword">self</span>.anchors.index( <span class="keyword">this</span> ) );</div>
<div class="line"><a name="l11114"></a><span class="lineno">11114</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l11115"></a><span class="lineno">11115</span>&#160;                <span class="keywordflow">throw</span> <span class="stringliteral">&quot;jQuery UI Tabs: Mismatching fragment identifier.&quot;</span>;</div>
<div class="line"><a name="l11116"></a><span class="lineno">11116</span>&#160;            }</div>
<div class="line"><a name="l11117"></a><span class="lineno">11117</span>&#160;</div>
<div class="line"><a name="l11118"></a><span class="lineno">11118</span>&#160;            <span class="comment">// Prevent IE from keeping other link focussed when using the back button</span></div>
<div class="line"><a name="l11119"></a><span class="lineno">11119</span>&#160;            <span class="comment">// and remove dotted border from clicked link. This is controlled via CSS</span></div>
<div class="line"><a name="l11120"></a><span class="lineno">11120</span>&#160;            <span class="comment">// in modern browsers; blur() removes focus from address bar in Firefox</span></div>
<div class="line"><a name="l11121"></a><span class="lineno">11121</span>&#160;            <span class="comment">// which can become a usability and annoying problem with tabs(&#39;rotate&#39;).</span></div>
<div class="line"><a name="l11122"></a><span class="lineno">11122</span>&#160;            <span class="keywordflow">if</span> ( $.browser.msie ) {</div>
<div class="line"><a name="l11123"></a><span class="lineno">11123</span>&#160;                this.blur();</div>
<div class="line"><a name="l11124"></a><span class="lineno">11124</span>&#160;            }</div>
<div class="line"><a name="l11125"></a><span class="lineno">11125</span>&#160;        });</div>
<div class="line"><a name="l11126"></a><span class="lineno">11126</span>&#160;</div>
<div class="line"><a name="l11127"></a><span class="lineno">11127</span>&#160;        <span class="comment">// disable click in any case</span></div>
<div class="line"><a name="l11128"></a><span class="lineno">11128</span>&#160;        this.anchors.bind( <span class="stringliteral">&quot;click.tabs&quot;</span>, <span class="keyword">function</span>(){</div>
<div class="line"><a name="l11129"></a><span class="lineno">11129</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l11130"></a><span class="lineno">11130</span>&#160;        });</div>
<div class="line"><a name="l11131"></a><span class="lineno">11131</span>&#160;    },</div>
<div class="line"><a name="l11132"></a><span class="lineno">11132</span>&#160;</div>
<div class="line"><a name="l11133"></a><span class="lineno">11133</span>&#160;    _getIndex: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l11134"></a><span class="lineno">11134</span>&#160;        <span class="comment">// meta-function to give users option to provide a href string instead of a numerical index.</span></div>
<div class="line"><a name="l11135"></a><span class="lineno">11135</span>&#160;        <span class="comment">// also sanitizes numerical indexes to valid values.</span></div>
<div class="line"><a name="l11136"></a><span class="lineno">11136</span>&#160;        <span class="keywordflow">if</span> ( typeof index == <span class="stringliteral">&quot;string&quot;</span> ) {</div>
<div class="line"><a name="l11137"></a><span class="lineno">11137</span>&#160;            index = this.anchors.index( this.anchors.filter( <span class="stringliteral">&quot;[href$=&#39;&quot;</span> + index + <span class="stringliteral">&quot;&#39;]&quot;</span> ) );</div>
<div class="line"><a name="l11138"></a><span class="lineno">11138</span>&#160;        }</div>
<div class="line"><a name="l11139"></a><span class="lineno">11139</span>&#160;</div>
<div class="line"><a name="l11140"></a><span class="lineno">11140</span>&#160;        <span class="keywordflow">return</span> index;</div>
<div class="line"><a name="l11141"></a><span class="lineno">11141</span>&#160;    },</div>
<div class="line"><a name="l11142"></a><span class="lineno">11142</span>&#160;</div>
<div class="line"><a name="l11143"></a><span class="lineno">11143</span>&#160;    destroy: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11144"></a><span class="lineno">11144</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l11145"></a><span class="lineno">11145</span>&#160;</div>
<div class="line"><a name="l11146"></a><span class="lineno">11146</span>&#160;        this.abort();</div>
<div class="line"><a name="l11147"></a><span class="lineno">11147</span>&#160;</div>
<div class="line"><a name="l11148"></a><span class="lineno">11148</span>&#160;        this.element</div>
<div class="line"><a name="l11149"></a><span class="lineno">11149</span>&#160;            .unbind( <span class="stringliteral">&quot;.tabs&quot;</span> )</div>
<div class="line"><a name="l11150"></a><span class="lineno">11150</span>&#160;            .removeClass( <span class="stringliteral">&quot;ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible&quot;</span> )</div>
<div class="line"><a name="l11151"></a><span class="lineno">11151</span>&#160;            .removeData( <span class="stringliteral">&quot;tabs&quot;</span> );</div>
<div class="line"><a name="l11152"></a><span class="lineno">11152</span>&#160;</div>
<div class="line"><a name="l11153"></a><span class="lineno">11153</span>&#160;        this.list.removeClass( <span class="stringliteral">&quot;ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;</span> );</div>
<div class="line"><a name="l11154"></a><span class="lineno">11154</span>&#160;</div>
<div class="line"><a name="l11155"></a><span class="lineno">11155</span>&#160;        this.anchors.each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l11156"></a><span class="lineno">11156</span>&#160;            var href = $.data( <span class="keyword">this</span>, <span class="stringliteral">&quot;href.tabs&quot;</span> );</div>
<div class="line"><a name="l11157"></a><span class="lineno">11157</span>&#160;            <span class="keywordflow">if</span> ( href ) {</div>
<div class="line"><a name="l11158"></a><span class="lineno">11158</span>&#160;                this.href = href;</div>
<div class="line"><a name="l11159"></a><span class="lineno">11159</span>&#160;            }</div>
<div class="line"><a name="l11160"></a><span class="lineno">11160</span>&#160;            var $this = $( this ).unbind( <span class="stringliteral">&quot;.tabs&quot;</span> );</div>
<div class="line"><a name="l11161"></a><span class="lineno">11161</span>&#160;            $.each( [ <span class="stringliteral">&quot;href&quot;</span>, <span class="stringliteral">&quot;load&quot;</span>, <span class="stringliteral">&quot;cache&quot;</span> ], <span class="keyword">function</span>( i, prefix ) {</div>
<div class="line"><a name="l11162"></a><span class="lineno">11162</span>&#160;                $this.removeData( prefix + <span class="stringliteral">&quot;.tabs&quot;</span> );</div>
<div class="line"><a name="l11163"></a><span class="lineno">11163</span>&#160;            });</div>
<div class="line"><a name="l11164"></a><span class="lineno">11164</span>&#160;        });</div>
<div class="line"><a name="l11165"></a><span class="lineno">11165</span>&#160;</div>
<div class="line"><a name="l11166"></a><span class="lineno">11166</span>&#160;        this.lis.unbind( <span class="stringliteral">&quot;.tabs&quot;</span> ).add( this.panels ).each(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l11167"></a><span class="lineno">11167</span>&#160;            <span class="keywordflow">if</span> ( $.data( <span class="keyword">this</span>, <span class="stringliteral">&quot;destroy.tabs&quot;</span> ) ) {</div>
<div class="line"><a name="l11168"></a><span class="lineno">11168</span>&#160;                $( this ).<span class="keyword">remove</span>();</div>
<div class="line"><a name="l11169"></a><span class="lineno">11169</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l11170"></a><span class="lineno">11170</span>&#160;                $( this ).removeClass([</div>
<div class="line"><a name="l11171"></a><span class="lineno">11171</span>&#160;                    <span class="stringliteral">&quot;ui-state-default&quot;</span>,</div>
<div class="line"><a name="l11172"></a><span class="lineno">11172</span>&#160;                    <span class="stringliteral">&quot;ui-corner-top&quot;</span>,</div>
<div class="line"><a name="l11173"></a><span class="lineno">11173</span>&#160;                    <span class="stringliteral">&quot;ui-tabs-selected&quot;</span>,</div>
<div class="line"><a name="l11174"></a><span class="lineno">11174</span>&#160;                    <span class="stringliteral">&quot;ui-state-active&quot;</span>,</div>
<div class="line"><a name="l11175"></a><span class="lineno">11175</span>&#160;                    <span class="stringliteral">&quot;ui-state-hover&quot;</span>,</div>
<div class="line"><a name="l11176"></a><span class="lineno">11176</span>&#160;                    <span class="stringliteral">&quot;ui-state-focus&quot;</span>,</div>
<div class="line"><a name="l11177"></a><span class="lineno">11177</span>&#160;                    <span class="stringliteral">&quot;ui-state-disabled&quot;</span>,</div>
<div class="line"><a name="l11178"></a><span class="lineno">11178</span>&#160;                    <span class="stringliteral">&quot;ui-tabs-panel&quot;</span>,</div>
<div class="line"><a name="l11179"></a><span class="lineno">11179</span>&#160;                    <span class="stringliteral">&quot;ui-widget-content&quot;</span>,</div>
<div class="line"><a name="l11180"></a><span class="lineno">11180</span>&#160;                    <span class="stringliteral">&quot;ui-corner-bottom&quot;</span>,</div>
<div class="line"><a name="l11181"></a><span class="lineno">11181</span>&#160;                    <span class="stringliteral">&quot;ui-tabs-hide&quot;</span></div>
<div class="line"><a name="l11182"></a><span class="lineno">11182</span>&#160;                ].join( <span class="stringliteral">&quot; &quot;</span> ) );</div>
<div class="line"><a name="l11183"></a><span class="lineno">11183</span>&#160;            }</div>
<div class="line"><a name="l11184"></a><span class="lineno">11184</span>&#160;        });</div>
<div class="line"><a name="l11185"></a><span class="lineno">11185</span>&#160;</div>
<div class="line"><a name="l11186"></a><span class="lineno">11186</span>&#160;        <span class="keywordflow">if</span> ( o.cookie ) {</div>
<div class="line"><a name="l11187"></a><span class="lineno">11187</span>&#160;            this._cookie( null, o.cookie );</div>
<div class="line"><a name="l11188"></a><span class="lineno">11188</span>&#160;        }</div>
<div class="line"><a name="l11189"></a><span class="lineno">11189</span>&#160;</div>
<div class="line"><a name="l11190"></a><span class="lineno">11190</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11191"></a><span class="lineno">11191</span>&#160;    },</div>
<div class="line"><a name="l11192"></a><span class="lineno">11192</span>&#160;</div>
<div class="line"><a name="l11193"></a><span class="lineno">11193</span>&#160;    add: <span class="keyword">function</span>( url, label, index ) {</div>
<div class="line"><a name="l11194"></a><span class="lineno">11194</span>&#160;        <span class="keywordflow">if</span> ( index === undefined ) {</div>
<div class="line"><a name="l11195"></a><span class="lineno">11195</span>&#160;            index = this.anchors.length;</div>
<div class="line"><a name="l11196"></a><span class="lineno">11196</span>&#160;        }</div>
<div class="line"><a name="l11197"></a><span class="lineno">11197</span>&#160;</div>
<div class="line"><a name="l11198"></a><span class="lineno">11198</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l11199"></a><span class="lineno">11199</span>&#160;            o = this.options,</div>
<div class="line"><a name="l11200"></a><span class="lineno">11200</span>&#160;            $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ),</div>
<div class="line"><a name="l11201"></a><span class="lineno">11201</span>&#160;            <span class="keywordtype">id</span> = !url.indexOf( <span class="stringliteral">&quot;#&quot;</span> ) ? url.replace( <span class="stringliteral">&quot;#&quot;</span>, <span class="stringliteral">&quot;&quot;</span> ) : this._tabId( $( <span class="stringliteral">&quot;a&quot;</span>, $li )[ 0 ] );</div>
<div class="line"><a name="l11202"></a><span class="lineno">11202</span>&#160;</div>
<div class="line"><a name="l11203"></a><span class="lineno">11203</span>&#160;        $li.addClass( <span class="stringliteral">&quot;ui-state-default ui-corner-top&quot;</span> ).data( <span class="stringliteral">&quot;destroy.tabs&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l11204"></a><span class="lineno">11204</span>&#160;</div>
<div class="line"><a name="l11205"></a><span class="lineno">11205</span>&#160;        <span class="comment">// try to find an existing element before creating a new one</span></div>
<div class="line"><a name="l11206"></a><span class="lineno">11206</span>&#160;        var $panel = <span class="keyword">self</span>.element.find( <span class="stringliteral">&quot;#&quot;</span> + <span class="keywordtype">id</span> );</div>
<div class="line"><a name="l11207"></a><span class="lineno">11207</span>&#160;        <span class="keywordflow">if</span> ( !$panel.length ) {</div>
<div class="line"><a name="l11208"></a><span class="lineno">11208</span>&#160;            $panel = $( o.panelTemplate )</div>
<div class="line"><a name="l11209"></a><span class="lineno">11209</span>&#160;                .attr( <span class="stringliteral">&quot;id&quot;</span>, <span class="keywordtype">id</span> )</div>
<div class="line"><a name="l11210"></a><span class="lineno">11210</span>&#160;                .data( <span class="stringliteral">&quot;destroy.tabs&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l11211"></a><span class="lineno">11211</span>&#160;        }</div>
<div class="line"><a name="l11212"></a><span class="lineno">11212</span>&#160;        $panel.addClass( <span class="stringliteral">&quot;ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l11213"></a><span class="lineno">11213</span>&#160;</div>
<div class="line"><a name="l11214"></a><span class="lineno">11214</span>&#160;        <span class="keywordflow">if</span> ( index &gt;= this.lis.length ) {</div>
<div class="line"><a name="l11215"></a><span class="lineno">11215</span>&#160;            $li.appendTo( this.list );</div>
<div class="line"><a name="l11216"></a><span class="lineno">11216</span>&#160;            $panel.appendTo( this.list[ 0 ].parentNode );</div>
<div class="line"><a name="l11217"></a><span class="lineno">11217</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l11218"></a><span class="lineno">11218</span>&#160;            $li.insertBefore( this.lis[ index ] );</div>
<div class="line"><a name="l11219"></a><span class="lineno">11219</span>&#160;            $panel.insertBefore( this.panels[ index ] );</div>
<div class="line"><a name="l11220"></a><span class="lineno">11220</span>&#160;        }</div>
<div class="line"><a name="l11221"></a><span class="lineno">11221</span>&#160;</div>
<div class="line"><a name="l11222"></a><span class="lineno">11222</span>&#160;        o.disabled = $.map( o.disabled, <span class="keyword">function</span>( n, i ) {</div>
<div class="line"><a name="l11223"></a><span class="lineno">11223</span>&#160;            <span class="keywordflow">return</span> n &gt;= index ? ++n : n;</div>
<div class="line"><a name="l11224"></a><span class="lineno">11224</span>&#160;        });</div>
<div class="line"><a name="l11225"></a><span class="lineno">11225</span>&#160;</div>
<div class="line"><a name="l11226"></a><span class="lineno">11226</span>&#160;        this._tabify();</div>
<div class="line"><a name="l11227"></a><span class="lineno">11227</span>&#160;</div>
<div class="line"><a name="l11228"></a><span class="lineno">11228</span>&#160;        <span class="keywordflow">if</span> ( this.anchors.length == 1 ) {</div>
<div class="line"><a name="l11229"></a><span class="lineno">11229</span>&#160;            o.selected = 0;</div>
<div class="line"><a name="l11230"></a><span class="lineno">11230</span>&#160;            $li.addClass( <span class="stringliteral">&quot;ui-tabs-selected ui-state-active&quot;</span> );</div>
<div class="line"><a name="l11231"></a><span class="lineno">11231</span>&#160;            $panel.removeClass( <span class="stringliteral">&quot;ui-tabs-hide&quot;</span> );</div>
<div class="line"><a name="l11232"></a><span class="lineno">11232</span>&#160;            this.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11233"></a><span class="lineno">11233</span>&#160;                <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;show&quot;</span>, null, <span class="keyword">self</span>._ui( <span class="keyword">self</span>.anchors[ 0 ], <span class="keyword">self</span>.panels[ 0 ] ) );</div>
<div class="line"><a name="l11234"></a><span class="lineno">11234</span>&#160;            });</div>
<div class="line"><a name="l11235"></a><span class="lineno">11235</span>&#160;</div>
<div class="line"><a name="l11236"></a><span class="lineno">11236</span>&#160;            this.load( 0 );</div>
<div class="line"><a name="l11237"></a><span class="lineno">11237</span>&#160;        }</div>
<div class="line"><a name="l11238"></a><span class="lineno">11238</span>&#160;</div>
<div class="line"><a name="l11239"></a><span class="lineno">11239</span>&#160;        this._trigger( <span class="stringliteral">&quot;add&quot;</span>, null, this._ui( this.anchors[ index ], this.panels[ index ] ) );</div>
<div class="line"><a name="l11240"></a><span class="lineno">11240</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11241"></a><span class="lineno">11241</span>&#160;    },</div>
<div class="line"><a name="l11242"></a><span class="lineno">11242</span>&#160;</div>
<div class="line"><a name="l11243"></a><span class="lineno">11243</span>&#160;    <span class="keyword">remove</span>: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l11244"></a><span class="lineno">11244</span>&#160;        index = this._getIndex( index );</div>
<div class="line"><a name="l11245"></a><span class="lineno">11245</span>&#160;        var o = this.options,</div>
<div class="line"><a name="l11246"></a><span class="lineno">11246</span>&#160;            $li = this.lis.eq( index ).remove(),</div>
<div class="line"><a name="l11247"></a><span class="lineno">11247</span>&#160;            $panel = this.panels.eq( index ).remove();</div>
<div class="line"><a name="l11248"></a><span class="lineno">11248</span>&#160;</div>
<div class="line"><a name="l11249"></a><span class="lineno">11249</span>&#160;        <span class="comment">// If selected tab was removed focus tab to the right or</span></div>
<div class="line"><a name="l11250"></a><span class="lineno">11250</span>&#160;        <span class="comment">// in case the last tab was removed the tab to the left.</span></div>
<div class="line"><a name="l11251"></a><span class="lineno">11251</span>&#160;        <span class="keywordflow">if</span> ( $li.hasClass( <span class="stringliteral">&quot;ui-tabs-selected&quot;</span> ) &amp;&amp; this.anchors.length &gt; 1) {</div>
<div class="line"><a name="l11252"></a><span class="lineno">11252</span>&#160;            this.select( index + ( index + 1 &lt; this.anchors.length ? 1 : -1 ) );</div>
<div class="line"><a name="l11253"></a><span class="lineno">11253</span>&#160;        }</div>
<div class="line"><a name="l11254"></a><span class="lineno">11254</span>&#160;</div>
<div class="line"><a name="l11255"></a><span class="lineno">11255</span>&#160;        o.disabled = $.map(</div>
<div class="line"><a name="l11256"></a><span class="lineno">11256</span>&#160;            $.grep( o.disabled, <span class="keyword">function</span>(n, i) {</div>
<div class="line"><a name="l11257"></a><span class="lineno">11257</span>&#160;                <span class="keywordflow">return</span> n != index;</div>
<div class="line"><a name="l11258"></a><span class="lineno">11258</span>&#160;            }),</div>
<div class="line"><a name="l11259"></a><span class="lineno">11259</span>&#160;            <span class="keyword">function</span>( n, i ) {</div>
<div class="line"><a name="l11260"></a><span class="lineno">11260</span>&#160;                <span class="keywordflow">return</span> n &gt;= index ? --n : n;</div>
<div class="line"><a name="l11261"></a><span class="lineno">11261</span>&#160;            });</div>
<div class="line"><a name="l11262"></a><span class="lineno">11262</span>&#160;</div>
<div class="line"><a name="l11263"></a><span class="lineno">11263</span>&#160;        this._tabify();</div>
<div class="line"><a name="l11264"></a><span class="lineno">11264</span>&#160;</div>
<div class="line"><a name="l11265"></a><span class="lineno">11265</span>&#160;        this._trigger( <span class="stringliteral">&quot;remove&quot;</span>, null, this._ui( $li.find( <span class="stringliteral">&quot;a&quot;</span> )[ 0 ], $panel[ 0 ] ) );</div>
<div class="line"><a name="l11266"></a><span class="lineno">11266</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11267"></a><span class="lineno">11267</span>&#160;    },</div>
<div class="line"><a name="l11268"></a><span class="lineno">11268</span>&#160;</div>
<div class="line"><a name="l11269"></a><span class="lineno">11269</span>&#160;    enable: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l11270"></a><span class="lineno">11270</span>&#160;        index = this._getIndex( index );</div>
<div class="line"><a name="l11271"></a><span class="lineno">11271</span>&#160;        var o = this.options;</div>
<div class="line"><a name="l11272"></a><span class="lineno">11272</span>&#160;        <span class="keywordflow">if</span> ( $.inArray( index, o.disabled ) == -1 ) {</div>
<div class="line"><a name="l11273"></a><span class="lineno">11273</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l11274"></a><span class="lineno">11274</span>&#160;        }</div>
<div class="line"><a name="l11275"></a><span class="lineno">11275</span>&#160;</div>
<div class="line"><a name="l11276"></a><span class="lineno">11276</span>&#160;        this.lis.eq( index ).removeClass( <span class="stringliteral">&quot;ui-state-disabled&quot;</span> );</div>
<div class="line"><a name="l11277"></a><span class="lineno">11277</span>&#160;        o.disabled = $.grep( o.disabled, <span class="keyword">function</span>( n, i ) {</div>
<div class="line"><a name="l11278"></a><span class="lineno">11278</span>&#160;            <span class="keywordflow">return</span> n != index;</div>
<div class="line"><a name="l11279"></a><span class="lineno">11279</span>&#160;        });</div>
<div class="line"><a name="l11280"></a><span class="lineno">11280</span>&#160;</div>
<div class="line"><a name="l11281"></a><span class="lineno">11281</span>&#160;        this._trigger( <span class="stringliteral">&quot;enable&quot;</span>, null, this._ui( this.anchors[ index ], this.panels[ index ] ) );</div>
<div class="line"><a name="l11282"></a><span class="lineno">11282</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11283"></a><span class="lineno">11283</span>&#160;    },</div>
<div class="line"><a name="l11284"></a><span class="lineno">11284</span>&#160;</div>
<div class="line"><a name="l11285"></a><span class="lineno">11285</span>&#160;    disable: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l11286"></a><span class="lineno">11286</span>&#160;        index = this._getIndex( index );</div>
<div class="line"><a name="l11287"></a><span class="lineno">11287</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>, o = this.options;</div>
<div class="line"><a name="l11288"></a><span class="lineno">11288</span>&#160;        <span class="comment">// cannot disable already selected tab</span></div>
<div class="line"><a name="l11289"></a><span class="lineno">11289</span>&#160;        <span class="keywordflow">if</span> ( index != o.selected ) {</div>
<div class="line"><a name="l11290"></a><span class="lineno">11290</span>&#160;            this.lis.eq( index ).addClass( <span class="stringliteral">&quot;ui-state-disabled&quot;</span> );</div>
<div class="line"><a name="l11291"></a><span class="lineno">11291</span>&#160;</div>
<div class="line"><a name="l11292"></a><span class="lineno">11292</span>&#160;            o.disabled.push( index );</div>
<div class="line"><a name="l11293"></a><span class="lineno">11293</span>&#160;            o.disabled.sort();</div>
<div class="line"><a name="l11294"></a><span class="lineno">11294</span>&#160;</div>
<div class="line"><a name="l11295"></a><span class="lineno">11295</span>&#160;            this._trigger( <span class="stringliteral">&quot;disable&quot;</span>, null, this._ui( this.anchors[ index ], this.panels[ index ] ) );</div>
<div class="line"><a name="l11296"></a><span class="lineno">11296</span>&#160;        }</div>
<div class="line"><a name="l11297"></a><span class="lineno">11297</span>&#160;</div>
<div class="line"><a name="l11298"></a><span class="lineno">11298</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11299"></a><span class="lineno">11299</span>&#160;    },</div>
<div class="line"><a name="l11300"></a><span class="lineno">11300</span>&#160;</div>
<div class="line"><a name="l11301"></a><span class="lineno">11301</span>&#160;    select: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l11302"></a><span class="lineno">11302</span>&#160;        index = this._getIndex( index );</div>
<div class="line"><a name="l11303"></a><span class="lineno">11303</span>&#160;        <span class="keywordflow">if</span> ( index == -1 ) {</div>
<div class="line"><a name="l11304"></a><span class="lineno">11304</span>&#160;            <span class="keywordflow">if</span> ( this.options.collapsible &amp;&amp; <span class="keyword">this</span>.options.selected != -1 ) {</div>
<div class="line"><a name="l11305"></a><span class="lineno">11305</span>&#160;                index = this.options.selected;</div>
<div class="line"><a name="l11306"></a><span class="lineno">11306</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l11307"></a><span class="lineno">11307</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11308"></a><span class="lineno">11308</span>&#160;            }</div>
<div class="line"><a name="l11309"></a><span class="lineno">11309</span>&#160;        }</div>
<div class="line"><a name="l11310"></a><span class="lineno">11310</span>&#160;        this.anchors.eq( index ).trigger( this.options.event + <span class="stringliteral">&quot;.tabs&quot;</span> );</div>
<div class="line"><a name="l11311"></a><span class="lineno">11311</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11312"></a><span class="lineno">11312</span>&#160;    },</div>
<div class="line"><a name="l11313"></a><span class="lineno">11313</span>&#160;</div>
<div class="line"><a name="l11314"></a><span class="lineno">11314</span>&#160;    load: <span class="keyword">function</span>( index ) {</div>
<div class="line"><a name="l11315"></a><span class="lineno">11315</span>&#160;        index = this._getIndex( index );</div>
<div class="line"><a name="l11316"></a><span class="lineno">11316</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l11317"></a><span class="lineno">11317</span>&#160;            o = this.options,</div>
<div class="line"><a name="l11318"></a><span class="lineno">11318</span>&#160;            a = this.anchors.eq( index )[ 0 ],</div>
<div class="line"><a name="l11319"></a><span class="lineno">11319</span>&#160;            url = $.data( a, <span class="stringliteral">&quot;load.tabs&quot;</span> );</div>
<div class="line"><a name="l11320"></a><span class="lineno">11320</span>&#160;</div>
<div class="line"><a name="l11321"></a><span class="lineno">11321</span>&#160;        this.abort();</div>
<div class="line"><a name="l11322"></a><span class="lineno">11322</span>&#160;</div>
<div class="line"><a name="l11323"></a><span class="lineno">11323</span>&#160;        <span class="comment">// not remote or from cache</span></div>
<div class="line"><a name="l11324"></a><span class="lineno">11324</span>&#160;        <span class="keywordflow">if</span> ( !url || this.element.queue( <span class="stringliteral">&quot;tabs&quot;</span> ).length !== 0 &amp;&amp; $.data( a, <span class="stringliteral">&quot;cache.tabs&quot;</span> ) ) {</div>
<div class="line"><a name="l11325"></a><span class="lineno">11325</span>&#160;            this.element.dequeue( <span class="stringliteral">&quot;tabs&quot;</span> );</div>
<div class="line"><a name="l11326"></a><span class="lineno">11326</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l11327"></a><span class="lineno">11327</span>&#160;        }</div>
<div class="line"><a name="l11328"></a><span class="lineno">11328</span>&#160;</div>
<div class="line"><a name="l11329"></a><span class="lineno">11329</span>&#160;        <span class="comment">// load remote from here on</span></div>
<div class="line"><a name="l11330"></a><span class="lineno">11330</span>&#160;        this.lis.eq( index ).addClass( <span class="stringliteral">&quot;ui-state-processing&quot;</span> );</div>
<div class="line"><a name="l11331"></a><span class="lineno">11331</span>&#160;</div>
<div class="line"><a name="l11332"></a><span class="lineno">11332</span>&#160;        <span class="keywordflow">if</span> ( o.spinner ) {</div>
<div class="line"><a name="l11333"></a><span class="lineno">11333</span>&#160;            var span = $( <span class="stringliteral">&quot;span&quot;</span>, a );</div>
<div class="line"><a name="l11334"></a><span class="lineno">11334</span>&#160;            span.data( <span class="stringliteral">&quot;label.tabs&quot;</span>, span.html() ).html( o.spinner );</div>
<div class="line"><a name="l11335"></a><span class="lineno">11335</span>&#160;        }</div>
<div class="line"><a name="l11336"></a><span class="lineno">11336</span>&#160;</div>
<div class="line"><a name="l11337"></a><span class="lineno">11337</span>&#160;        this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, {</div>
<div class="line"><a name="l11338"></a><span class="lineno">11338</span>&#160;            url: url,</div>
<div class="line"><a name="l11339"></a><span class="lineno">11339</span>&#160;            success: <span class="keyword">function</span>( r, s ) {</div>
<div class="line"><a name="l11340"></a><span class="lineno">11340</span>&#160;                <span class="keyword">self</span>.element.find( <span class="keyword">self</span>._sanitizeSelector( a.hash ) ).html( r );</div>
<div class="line"><a name="l11341"></a><span class="lineno">11341</span>&#160;</div>
<div class="line"><a name="l11342"></a><span class="lineno">11342</span>&#160;                <span class="comment">// take care of tab labels</span></div>
<div class="line"><a name="l11343"></a><span class="lineno">11343</span>&#160;                <span class="keyword">self</span>._cleanup();</div>
<div class="line"><a name="l11344"></a><span class="lineno">11344</span>&#160;</div>
<div class="line"><a name="l11345"></a><span class="lineno">11345</span>&#160;                <span class="keywordflow">if</span> ( o.cache ) {</div>
<div class="line"><a name="l11346"></a><span class="lineno">11346</span>&#160;                    $.data( a, <span class="stringliteral">&quot;cache.tabs&quot;</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l11347"></a><span class="lineno">11347</span>&#160;                }</div>
<div class="line"><a name="l11348"></a><span class="lineno">11348</span>&#160;</div>
<div class="line"><a name="l11349"></a><span class="lineno">11349</span>&#160;                <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;load&quot;</span>, null, <span class="keyword">self</span>._ui( <span class="keyword">self</span>.anchors[ index ], <span class="keyword">self</span>.panels[ index ] ) );</div>
<div class="line"><a name="l11350"></a><span class="lineno">11350</span>&#160;                <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l11351"></a><span class="lineno">11351</span>&#160;                    o.ajaxOptions.success( r, s );</div>
<div class="line"><a name="l11352"></a><span class="lineno">11352</span>&#160;                }</div>
<div class="line"><a name="l11353"></a><span class="lineno">11353</span>&#160;                <span class="keywordflow">catch</span> ( e ) {}</div>
<div class="line"><a name="l11354"></a><span class="lineno">11354</span>&#160;            },</div>
<div class="line"><a name="l11355"></a><span class="lineno">11355</span>&#160;            error: <span class="keyword">function</span>( xhr, s, e ) {</div>
<div class="line"><a name="l11356"></a><span class="lineno">11356</span>&#160;                <span class="comment">// take care of tab labels</span></div>
<div class="line"><a name="l11357"></a><span class="lineno">11357</span>&#160;                <span class="keyword">self</span>._cleanup();</div>
<div class="line"><a name="l11358"></a><span class="lineno">11358</span>&#160;</div>
<div class="line"><a name="l11359"></a><span class="lineno">11359</span>&#160;                <span class="keyword">self</span>._trigger( <span class="stringliteral">&quot;load&quot;</span>, null, <span class="keyword">self</span>._ui( <span class="keyword">self</span>.anchors[ index ], <span class="keyword">self</span>.panels[ index ] ) );</div>
<div class="line"><a name="l11360"></a><span class="lineno">11360</span>&#160;                <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l11361"></a><span class="lineno">11361</span>&#160;                    <span class="comment">// Passing index avoid a race condition when this method is</span></div>
<div class="line"><a name="l11362"></a><span class="lineno">11362</span>&#160;                    <span class="comment">// called after the user has selected another tab.</span></div>
<div class="line"><a name="l11363"></a><span class="lineno">11363</span>&#160;                    <span class="comment">// Pass the anchor that initiated this request allows</span></div>
<div class="line"><a name="l11364"></a><span class="lineno">11364</span>&#160;                    <span class="comment">// loadError to manipulate the tab content panel via $(a.hash)</span></div>
<div class="line"><a name="l11365"></a><span class="lineno">11365</span>&#160;                    o.ajaxOptions.error( xhr, s, index, a );</div>
<div class="line"><a name="l11366"></a><span class="lineno">11366</span>&#160;                }</div>
<div class="line"><a name="l11367"></a><span class="lineno">11367</span>&#160;                <span class="keywordflow">catch</span> ( e ) {}</div>
<div class="line"><a name="l11368"></a><span class="lineno">11368</span>&#160;            }</div>
<div class="line"><a name="l11369"></a><span class="lineno">11369</span>&#160;        } ) );</div>
<div class="line"><a name="l11370"></a><span class="lineno">11370</span>&#160;</div>
<div class="line"><a name="l11371"></a><span class="lineno">11371</span>&#160;        <span class="comment">// last, so that load event is fired before show...</span></div>
<div class="line"><a name="l11372"></a><span class="lineno">11372</span>&#160;        <span class="keyword">self</span>.element.dequeue( <span class="stringliteral">&quot;tabs&quot;</span> );</div>
<div class="line"><a name="l11373"></a><span class="lineno">11373</span>&#160;</div>
<div class="line"><a name="l11374"></a><span class="lineno">11374</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11375"></a><span class="lineno">11375</span>&#160;    },</div>
<div class="line"><a name="l11376"></a><span class="lineno">11376</span>&#160;</div>
<div class="line"><a name="l11377"></a><span class="lineno">11377</span>&#160;    abort: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11378"></a><span class="lineno">11378</span>&#160;        <span class="comment">// stop possibly running animations</span></div>
<div class="line"><a name="l11379"></a><span class="lineno">11379</span>&#160;        this.element.queue( [] );</div>
<div class="line"><a name="l11380"></a><span class="lineno">11380</span>&#160;        this.panels.stop( <span class="keyword">false</span>, <span class="keyword">true</span> );</div>
<div class="line"><a name="l11381"></a><span class="lineno">11381</span>&#160;</div>
<div class="line"><a name="l11382"></a><span class="lineno">11382</span>&#160;        <span class="comment">// &quot;tabs&quot; queue must not contain more than two elements,</span></div>
<div class="line"><a name="l11383"></a><span class="lineno">11383</span>&#160;        <span class="comment">// which are the callbacks for the latest clicked tab...</span></div>
<div class="line"><a name="l11384"></a><span class="lineno">11384</span>&#160;        this.element.queue( <span class="stringliteral">&quot;tabs&quot;</span>, this.element.queue( <span class="stringliteral">&quot;tabs&quot;</span> ).splice( -2, 2 ) );</div>
<div class="line"><a name="l11385"></a><span class="lineno">11385</span>&#160;</div>
<div class="line"><a name="l11386"></a><span class="lineno">11386</span>&#160;        <span class="comment">// terminate pending requests from other tabs</span></div>
<div class="line"><a name="l11387"></a><span class="lineno">11387</span>&#160;        <span class="keywordflow">if</span> ( this.xhr ) {</div>
<div class="line"><a name="l11388"></a><span class="lineno">11388</span>&#160;            this.xhr.abort();</div>
<div class="line"><a name="l11389"></a><span class="lineno">11389</span>&#160;            <span class="keyword">delete</span> this.xhr;</div>
<div class="line"><a name="l11390"></a><span class="lineno">11390</span>&#160;        }</div>
<div class="line"><a name="l11391"></a><span class="lineno">11391</span>&#160;</div>
<div class="line"><a name="l11392"></a><span class="lineno">11392</span>&#160;        <span class="comment">// take care of tab labels</span></div>
<div class="line"><a name="l11393"></a><span class="lineno">11393</span>&#160;        this._cleanup();</div>
<div class="line"><a name="l11394"></a><span class="lineno">11394</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11395"></a><span class="lineno">11395</span>&#160;    },</div>
<div class="line"><a name="l11396"></a><span class="lineno">11396</span>&#160;</div>
<div class="line"><a name="l11397"></a><span class="lineno">11397</span>&#160;    url: <span class="keyword">function</span>( index, url ) {</div>
<div class="line"><a name="l11398"></a><span class="lineno">11398</span>&#160;        this.anchors.eq( index ).removeData( <span class="stringliteral">&quot;cache.tabs&quot;</span> ).data( <span class="stringliteral">&quot;load.tabs&quot;</span>, url );</div>
<div class="line"><a name="l11399"></a><span class="lineno">11399</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11400"></a><span class="lineno">11400</span>&#160;    },</div>
<div class="line"><a name="l11401"></a><span class="lineno">11401</span>&#160;</div>
<div class="line"><a name="l11402"></a><span class="lineno">11402</span>&#160;    length: <span class="keyword">function</span>() {</div>
<div class="line"><a name="l11403"></a><span class="lineno">11403</span>&#160;        <span class="keywordflow">return</span> this.anchors.length;</div>
<div class="line"><a name="l11404"></a><span class="lineno">11404</span>&#160;    }</div>
<div class="line"><a name="l11405"></a><span class="lineno">11405</span>&#160;});</div>
<div class="line"><a name="l11406"></a><span class="lineno">11406</span>&#160;</div>
<div class="line"><a name="l11407"></a><span class="lineno">11407</span>&#160;$.extend( $.ui.tabs, {</div>
<div class="line"><a name="l11408"></a><span class="lineno">11408</span>&#160;    version: <span class="stringliteral">&quot;1.8.20&quot;</span></div>
<div class="line"><a name="l11409"></a><span class="lineno">11409</span>&#160;});</div>
<div class="line"><a name="l11410"></a><span class="lineno">11410</span>&#160;</div>
<div class="line"><a name="l11411"></a><span class="lineno">11411</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l11412"></a><span class="lineno">11412</span>&#160;<span class="comment"> * Tabs Extensions</span></div>
<div class="line"><a name="l11413"></a><span class="lineno">11413</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l11414"></a><span class="lineno">11414</span>&#160;</div>
<div class="line"><a name="l11415"></a><span class="lineno">11415</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l11416"></a><span class="lineno">11416</span>&#160;<span class="comment"> * Rotate</span></div>
<div class="line"><a name="l11417"></a><span class="lineno">11417</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l11418"></a><span class="lineno">11418</span>&#160;$.extend( $.ui.tabs.prototype, {</div>
<div class="line"><a name="l11419"></a><span class="lineno">11419</span>&#160;    rotation: null,</div>
<div class="line"><a name="l11420"></a><span class="lineno">11420</span>&#160;    rotate: <span class="keyword">function</span>( ms, continuing ) {</div>
<div class="line"><a name="l11421"></a><span class="lineno">11421</span>&#160;        var <span class="keyword">self</span> = <span class="keyword">this</span>,</div>
<div class="line"><a name="l11422"></a><span class="lineno">11422</span>&#160;            o = <span class="keyword">this</span>.options;</div>
<div class="line"><a name="l11423"></a><span class="lineno">11423</span>&#160;</div>
<div class="line"><a name="l11424"></a><span class="lineno">11424</span>&#160;        var rotate = <span class="keyword">self</span>._rotate || ( <span class="keyword">self</span>._rotate = <span class="keyword">function</span>( e ) {</div>
<div class="line"><a name="l11425"></a><span class="lineno">11425</span>&#160;            clearTimeout( <span class="keyword">self</span>.rotation );</div>
<div class="line"><a name="l11426"></a><span class="lineno">11426</span>&#160;            <span class="keyword">self</span>.rotation = setTimeout(<span class="keyword">function</span>() {</div>
<div class="line"><a name="l11427"></a><span class="lineno">11427</span>&#160;                var t = o.selected;</div>
<div class="line"><a name="l11428"></a><span class="lineno">11428</span>&#160;                <span class="keyword">self</span>.select( ++t &lt; <span class="keyword">self</span>.anchors.length ? t : 0 );</div>
<div class="line"><a name="l11429"></a><span class="lineno">11429</span>&#160;            }, ms );</div>
<div class="line"><a name="l11430"></a><span class="lineno">11430</span>&#160;            </div>
<div class="line"><a name="l11431"></a><span class="lineno">11431</span>&#160;            <span class="keywordflow">if</span> ( e ) {</div>
<div class="line"><a name="l11432"></a><span class="lineno">11432</span>&#160;                e.stopPropagation();</div>
<div class="line"><a name="l11433"></a><span class="lineno">11433</span>&#160;            }</div>
<div class="line"><a name="l11434"></a><span class="lineno">11434</span>&#160;        });</div>
<div class="line"><a name="l11435"></a><span class="lineno">11435</span>&#160;</div>
<div class="line"><a name="l11436"></a><span class="lineno">11436</span>&#160;        var stop = <span class="keyword">self</span>._unrotate || ( <span class="keyword">self</span>._unrotate = !continuing</div>
<div class="line"><a name="l11437"></a><span class="lineno">11437</span>&#160;            ? <span class="keyword">function</span>(e) {</div>
<div class="line"><a name="l11438"></a><span class="lineno">11438</span>&#160;                <span class="keywordflow">if</span> (e.clientX) { <span class="comment">// in case of a true click</span></div>
<div class="line"><a name="l11439"></a><span class="lineno">11439</span>&#160;                    <span class="keyword">self</span>.rotate(null);</div>
<div class="line"><a name="l11440"></a><span class="lineno">11440</span>&#160;                }</div>
<div class="line"><a name="l11441"></a><span class="lineno">11441</span>&#160;            }</div>
<div class="line"><a name="l11442"></a><span class="lineno">11442</span>&#160;            : <span class="keyword">function</span>( e ) {</div>
<div class="line"><a name="l11443"></a><span class="lineno">11443</span>&#160;                rotate();</div>
<div class="line"><a name="l11444"></a><span class="lineno">11444</span>&#160;            });</div>
<div class="line"><a name="l11445"></a><span class="lineno">11445</span>&#160;</div>
<div class="line"><a name="l11446"></a><span class="lineno">11446</span>&#160;        <span class="comment">// start rotation</span></div>
<div class="line"><a name="l11447"></a><span class="lineno">11447</span>&#160;        <span class="keywordflow">if</span> ( ms ) {</div>
<div class="line"><a name="l11448"></a><span class="lineno">11448</span>&#160;            this.element.bind( <span class="stringliteral">&quot;tabsshow&quot;</span>, rotate );</div>
<div class="line"><a name="l11449"></a><span class="lineno">11449</span>&#160;            this.anchors.bind( o.event + <span class="stringliteral">&quot;.tabs&quot;</span>, stop );</div>
<div class="line"><a name="l11450"></a><span class="lineno">11450</span>&#160;            rotate();</div>
<div class="line"><a name="l11451"></a><span class="lineno">11451</span>&#160;        <span class="comment">// stop rotation</span></div>
<div class="line"><a name="l11452"></a><span class="lineno">11452</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l11453"></a><span class="lineno">11453</span>&#160;            clearTimeout( <span class="keyword">self</span>.rotation );</div>
<div class="line"><a name="l11454"></a><span class="lineno">11454</span>&#160;            this.element.unbind( <span class="stringliteral">&quot;tabsshow&quot;</span>, rotate );</div>
<div class="line"><a name="l11455"></a><span class="lineno">11455</span>&#160;            this.anchors.unbind( o.event + <span class="stringliteral">&quot;.tabs&quot;</span>, stop );</div>
<div class="line"><a name="l11456"></a><span class="lineno">11456</span>&#160;            <span class="keyword">delete</span> this._rotate;</div>
<div class="line"><a name="l11457"></a><span class="lineno">11457</span>&#160;            <span class="keyword">delete</span> this._unrotate;</div>
<div class="line"><a name="l11458"></a><span class="lineno">11458</span>&#160;        }</div>
<div class="line"><a name="l11459"></a><span class="lineno">11459</span>&#160;</div>
<div class="line"><a name="l11460"></a><span class="lineno">11460</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">this</span>;</div>
<div class="line"><a name="l11461"></a><span class="lineno">11461</span>&#160;    }</div>
<div class="line"><a name="l11462"></a><span class="lineno">11462</span>&#160;});</div>
<div class="line"><a name="l11463"></a><span class="lineno">11463</span>&#160;</div>
<div class="line"><a name="l11464"></a><span class="lineno">11464</span>&#160;})( jQuery );</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Erzeugt am Don Dez 12 2013 10:15:58 für Homework Hub von &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
